1

I am working on a presentation with some functions plotted.

Unfortunately my graphs are above my \psgrid. How can I cut them automatically?

This is my code:

 \begin{figure}
 \psset{unit=0.7, linewidth=0.7\pslinewidth, mathLabel=false}
 \begin{pspicture}[showgrid=false](-3, -4) (3, 4)
 \psgrid[griddots=5, subgriddiv=0, gridlabels=0pt](-3, -4)(3, 4)
 \psplot[algebraic, plotstyle=line, plotpoints=500, linecolor=red]{-3}{3}{x^3}
 \end{pspicture}
 \end{figure}

And this is how it looks like:

picture

  • Provide us with a complete but minimal source code that can be used to reproduce your issue. – Artificial Stupidity Jan 19 '18 at 18:13
  • @ArtificialStupidity sorry I had a mistake in my code. Now it should work – linux_lover Jan 19 '18 at 18:55
  • Use pspicture* instead of pspicture. – Bernard Jan 19 '18 at 19:48
0

Only for emergency purpose.

\documentclass[pstricks,margin=1cm]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-3,-4)(3,4)
\psgrid[griddots=5,subgriddiv=0,gridlabels=0pt](-3,-4)(3,4)
\psaxes{->}(0,0)(-3, -4)(3, 4)[$x$,0][$y$,90]
\rput(0,0){\begin{pspicture*}(-3,-4)(3,4)\psplot[algebraic,linecolor=red]{-3}{3}{x^3}\end{pspicture*}}
\end{pspicture}
\end{document}

enter image description here

  • Thanks! That solved my problem. But why is it only for an emergency? – linux_lover Jan 19 '18 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.