1

What I have done

I placed a \psframe in a pspicture-environment and also some \psaxes and a \psplot.

\documentclass{scrbook}
\usepackage{pstricks}
\usepackage{pstricks-add, pst-plot}
\usepackage[crop=off]{auto-pst-pdf}

\begin{document}

\begin{pspicture}(10,20)

\psframe[fillstyle=solid, fillcolor=white](10,20)

\psaxes(2,2)(1,1)(4,4)
\psplot{0}{4}{x}

\end{pspicture}

\end{document}

What I would like

At the moment the plot uses the point (0,0) as its origin, which is the bottom-left coordinate of the pspicture-environment and the frame. I would like \psplot to use (2,2) from \psaxes as its origin for plotting. That means that if for some reason I move around the \psaxes in the frame (e.g. to make room for other objects) or the \psplot-function grows somewhat more complex, I don´t have to worry moving the plot around, as it always revolves around (2,2).

If the function goes like this, for example: \psplot{0}{4}{x exp 2}, I would not have to do anything, as the {0}{4} would be relative to (2,2) from \psaxes. Is this doable or for some other reason very dumb?

2

You can move the plots with \rput.

\documentclass{scrbook}
\usepackage{pstricks}
\usepackage{pstricks-add, pst-plot}
\usepackage[crop=off]{auto-pst-pdf}

\begin{document}

\begin{pspicture}(10,20)

\psframe[fillstyle=solid, fillcolor=white](10,20)

\psaxes(2,2)(1,1)(4,4)
\psplot{0}{2.5}{x mul x}

\psset{linecolor=blue}
\rput(2,2){\psplot{0}{2.5}{x mul x}}
\end{pspicture}
\end{document}

enter image description here

1

This is easy with the origini={abscissa,ordinate}key (note the use of braces, not parentheses). Also, the algebraic option lets you enter with the usual notation, not R.P.N.:

\documentclass[svgnames]{scrbook}
\usepackage{pstricks-add}
\usepackage[crop=off]{auto-pst-pdf}

\begin{document}

\begin{pspicture}(10,20)

\psframe[fillstyle=solid, fillcolor=white](10,20)

\psaxes(2,2)(1,1)(4,4)
\psset{origin = {2,2}, algebraic}
\psplot{0}{4}{x}
\psplot[linecolor = IndianRed]{0}{4}{x^2}

\end{pspicture}

\end{document} 

enter image description here

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.