5.87 How to export a plot to PDF?

I could only find a way to export to eps

plotsetup(default): 
plotsetup(postscript, plotoutput=`t.eps`, plotoptions=`color,portrait,height=300`); 
plot(sin(x),x=-Pi..Pi,'gridlines'); 
plotsetup(default):
 

Make sure not to put : at the end of the plot command! else it will not be exported. It has to end with ;

This will same it to t.eps in the currentdir() location. Then used ps2pdf t.eps t.pdf to convert it to PDF. Or just ps2pdf t.eps it will automatically create t.pdf

Or ps2pdf -dCompatibilityLevel=1.4  t.eps but may it is best to do

ps2pdf -dCompatibilityLevel=1.4 -dEmbedAllFonts=true  t.eps

Also try adding

-dPDFSETTINGS=/printer

to the above. This tells it to optimize it for printing.

Another example of a direction field for an ODE

plotsetup(postscript, plotoutput=`t0.eps`, plotoptions=`color,portrait, height=300` ); 
ode:= diff(y(x),x) = 3*x^2 - 1; 
DEtools:-DEplot( ode, y(x), x=-2..2, [y(0) = 0], y=-2..2, 
              linecolour=red, color = blue, stepsize=.05,arrows=MEDIUM ); 
plotsetup(default);