1

When using \psplot in PS form (or algebraic=false) the interval must be specified in degrees. However, sometimes, I need algebraic=false but interval is given in radian. Is it possible to achieve this scenario?

The following code shows that the output of plotting r=2^(x/2) (radius as a function of angle x) with algebraic=false and algebraic=true are different because PSTricks assumes that interval in first case is in degrees.

\documentclass[preview,border=12pt]{standalone} \usepackage{pst-plot} \psset{polarplot} \begin{document} \begin{pspicture}[showgrid=true](-3,-3)(3,3) \psplot{2 Pi mul neg}{2 Pi mul}{2 x 10 div exp} \end{pspicture}\qquad \begin{pspicture}[showgrid=true](-3,-3)(3,3) \psplot[algebraic]{2 Pi mul neg}{2 Pi mul}{2^(x/10)} \end{pspicture} \end{document} 

enter image description here

How to make a radian argument still get interpreted in radian when working with \psplot in PostScript form?

8
  • 1
    The file pst-plot.tex contains a line F@pstplot x \ifPst@algebraic RadtoDeg \fi PtoC, so this conversion for algebraic=true is fixed. Bug or feature, this may be answered by @Herbert. Commented Sep 18, 2013 at 6:37
  • 1
    @Christoph: I think it is a bug because the code writers did not anticipate the case in which the interval can represent not only angle but also non-angle. Commented Sep 18, 2013 at 6:42
  • if f(x) is in PS notation then we have x1 and x2 also in PS notation and that is degrees! Commented Sep 18, 2013 at 6:48
  • @Herbert: Then this feature will not allow \psplot[polarplot]{<RPN>}{<RPN>}{<RPN>} to plot a graph of r=f(t)=a^t for example. Commented Sep 18, 2013 at 6:55
  • your first example shows exactly this case! Commented Sep 18, 2013 at 7:01

1 Answer 1

2

this will be the same with the correct syntax!

\documentclass[preview,border=12pt]{standalone} \usepackage{pst-plot} \psset{polarplot} \begin{document} \begin{pspicture}[showgrid](-3,-3)(3,3) \psplot{2 Pi mul neg RadtoDeg }{2 Pi mul RadtoDeg}{2 x DegtoRad 10 div exp} \end{pspicture}\qquad \begin{pspicture}[showgrid](-3,-3)(3,3) \psplot[algebraic]{2 Pi mul neg}{2 Pi mul}{2^(x/10)} \end{pspicture} \end{document} 
2
  • What is wrong?? (Pi,2^(Pi/10) is (3.14,1.2) Commented Sep 18, 2013 at 7:57
  • OK. I was wrong. The point cannot be represented in RPN-Infix syntax because the function represents r value rather than y. Commented Sep 18, 2013 at 7:59

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.