
Ich habe die folgenden Codes in Miktex+Texmaker mit den Konfigurationen LaTeX+dvips+ps2pdf+PDF anzeigen:
Deutlich erkennbar ist folgende erste Abbildung ( 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
Die folgende zweite Abbildung ( ) erscheint jedoch nicht in der Zusammenstellung.
\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}
Bitte helfen Sie mir, die zweiten Graphen von \sin(x)
und zu zeichnen \cos(x)
.
Die zugehörige Frage hat die LösungenHier.
Antwort1
Sie brauchen die Möglichkeit algebraic
, dies global zu tun mit\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}