4

I want to use PSTricks in order to plot data in a file. In general I know how to do it but the problem now is that these data run from x=-2000...2000 and y=1.e-10...1e-3 so I get the "too large" error. When I try to change the data or the axis, I have a new problem: I can't get the right ticks. Does any body have a solution to this problem?

2
  • 3
    Can you provide your non-working but minimal code ans some dummy data?
    – percusse
    Commented Jun 23, 2012 at 11:02
  • 2
    Also you should go over your old questions and check whether you consider them answered. If you do, you should mark them as such by clicking the tick mark next to the best answer. If you haven't received the answers you were looking for, you should edit your questions to include more information.
    – Jake
    Commented Jun 23, 2012 at 11:13

2 Answers 2

4

you can scale points different to the coordinates values:

\documentclass{report}
\usepackage{pst-plot}

\begin{document}
\def\demoValues{-2000 1.e-10 -1000 1.e-5 0 0 1000 1.e-4 2000 1.e-3}
\begin{psgraph}[arrows=->,ticksize=0 5pt,
  Dy=0.2,
  xlabelFactor=\cdot10^3,
  ylabelFactor=\cdot10^{-3},
  ](0,0)(-2.2,-0.1)(2.2,1.1){7cm}{7cm}
  \pstScalePoints(1,1){1000 div}{1.e3 mul}
  \listplot[plotstyle=dots,dotstyle=x,dotscale=2,linecolor=red]
  {\demoValues}
\end{psgraph}
\end{document}

enter image description here

Using a log axis for y may make sense here.

2
  • Thank you very much. Is it possible to change label "x" and "y" with psgraph?
    – PanAkry
    Commented Jun 23, 2012 at 15:04
  • sure, for example: \psset{xAxisLabel=x-Value,xAxisLabelPos={c,-0.2}} write it before psgraph. Same is possible for the y axis.
    – user2478
    Commented Jun 23, 2012 at 15:37
2

If you use pgfplots, there's no need to scale the data manually, it handles the scaling automatically:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table {
-2000 1e-10
-1000 1e-5
0 0
1000 1e-4
2000 1e-3
};
\end{axis}
\end{tikzpicture}
\end{document}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .