
LaTeX+dvips+ps2pdf+View PDF 구성을 사용하여 Miktex+Texmaker에 다음 코드가 있습니다.
다음 첫 번째 그림( fig:cosine-plot
)이 명확하게 나타납니다.
\begin{figure}[H]
\centering
\begin{pspicture}(-2,-1.5)(4,1.5)
\psaxes{->}(0,0)(-2,-1.5)(4,1.5)[$x$,0][$y$,90]
\psplot[linecolor=red, algebraic]{-2}{3.5}{cos(x)}
\end{pspicture}
\caption{Plot of $\cos(x)$}
\label{fig:cosine-plot}
\end{figure}
그러나 다음 두 번째 그림( Fig-sin-cos
)은 편집본에 나타나지 않습니다.
\begin{figure}[H]
\centering
\begin{pspicture}(-2,-1.5)(4,1.5)
\psgrid[griddots=10,gridlabels=0pt, subgriddiv=0, gridcolor=black!20]
\psaxes{->}(0,0)(-2,-1.5)(4,1.5)
\psplot[linecolor=blue]{-2}{4}{sin(x)}
\psplot[linecolor=red]{-2}{4}{cos(x)}
\end{pspicture}
\caption{Graphs of $\sin(x)$ and $\cos(x)$}\label{Fig-sin-cos}
\end{figure}
\sin(x)
와 의 두 번째 그래프를 그릴 수 있도록 도와주세요 \cos(x)
.
관련 질문에 해결책이 있습니다여기.
답변1
옵션이 필요합니다 algebraic
. 다음을 사용하여 전 세계적으로 수행할 수 있습니다.\psset{algebraic}
\documentclass[11pt]{article}
\usepackage{pst-all}
\begin{document}
\psset{algebraic} %change
\begin{figure}[ht]
\centering
\begin{pspicture}(-2,-1.5)(4,1.5)
\psgrid[griddots=10,gridlabels=0pt, subgriddiv=0, gridcolor=black!20]
\psaxes{->}(0,0)(-2,-1.5)(4,1.5)
\psplot[linecolor=blue]{-2}{4}{sin(x)}
\psplot[linecolor=red]{-2}{4}{cos(x)}
\end{pspicture}
\caption{Graphs of $\sin(x)$ and $\cos(x)$}\label{Fig-sin-cos}
\end{figure}
\end{document}