Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
3  
Can you provide your non-working but minimal code ans some dummy data? –  percusse Jun 23 '12 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 Jun 23 '12 at 11:13
add comment

2 Answers

up vote 4 down vote accepted

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.

share|improve this answer
    
Thank you very much. Is it possible to change label "x" and "y" with psgraph? –  PanAkry Jun 23 '12 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. –  Herbert Jun 23 '12 at 15:37
add comment

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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