[pstricks] psgraph pstScalePoints and labels

Antoine Pairet lists at pairet.be
Fri May 29 19:26:00 CEST 2009


Thanks for the quick answer. However it is not want I need. Maybe I was
not clear enough.


> \begin{psgraph}[Dy=1.000,Oy=-11.444,Ox=4]{->}(4,0)(4,-2)(14,4){9cm}{5cm}


This will make the labels to be equal to -11.444, -10.444, -9.444 etc.
Want I'd like to have is the same scaling on the points I'm plotting on
the labels of the psgraph env.

The labels should evolves this way: -11.444, -11.434, -11.424 etc. At
each step an increment of .01 should be added. This way the labels would
be coherent with the scaling performed on the data by the command
\pstScalePoints(1,100){}{11.444 add}.

I will provide three examples in the hope everything is more clear:
 1. original example
 2. example where the label values where "hardcoded" using \psyTick(){}
=> target behaviour
 3. example 1 with technique of example 2; because of Ox=4, this does
not work, \psyTick places the tics and the labels at x=0

What I am looking for is a automation of the process used in the second
example that works even if Ox /= 0.
Attached is the PDF of the output.

Thanks in advance,
Antoine Pairet

\begin{filecontents}{data.dat}
   13.23251400000000  -11.44268228200000    4.59849657000000
1.40493544877201
   11.57844475000000  -11.44269146500000    4.59849918080000
1.40493624640736
    9.92438550000000  -11.44276508800000    4.59866092640000
1.40498566307214
    8.27032125000000  -11.44327883750000    4.59929667740000
1.40517989807378
    6.61628200000000  -11.44431177300000    4.59929726250000
1.40518007679451
    4.96219275000000  -11.43676810200000    4.59398967360000
1.40355849908927
\end{filecontents}
\begin{filecontents}{ecutConv.dat}
  15  -11.376356813   0   4.5902838585   0
  20  -11.428570691    1.91882   4.6103186999    0.43551
  25  -11.441164384     0.4628   4.5999206137    0.22579
  30  -11.442810833     0.0605   4.5987293498     0.0259
  35  -11.443131625    0.01178    4.598484173    0.00533
  40  -11.443384818     0.0093   4.5984883638      9e-05
  45  -11.443594054    0.00768   4.5982745531    0.00464
  50  -11.443709076    0.00422   4.5981886466    0.00186
  55  -11.443761573    0.00192   4.5981566868    0.00069
  60  -11.443782124    0.00075   4.5981607152      8e-05
  65   -11.44378715    0.00018    4.598157398      7e-05
  70  -11.443787675      1e-05   4.5981572697   0
\end{filecontents}
\documentclass{article}
\usepackage{pstricks-add}

\begin{document}
\readdata{\heightEne}{data.dat}
\readdata{\ecutConv}{ecutConv.dat}

\section{first example}
\psset{plotstyle=dots,lly=-.25,llx=-2.5,urx=3,ury=2}
\begin{psgraph}[Dy=1.000,Oy=-11.444,Ox=4]{->}(4,0)(4,-2)(14,4){9cm}{5cm}
	\pstScalePoints(1,100){}{11.444 add}
	\psset{plotNo=1,plotNoMax=3}
	\listplot[linecolor=red]{\heightEne}
\end{psgraph}
\pstScalePoints(1,1){}{}

\section{second example}
\begin{psgraph}[Dx=10,Dy=10]{->}(0,0)(0,-1)(90,8){9cm}{5cm}
	\psyTick(0){-11.444}
	\psyTick(2){-11.424}
	\psyTick(4){-11.404}
	\psyTick(6){-11.384}
	\pstScalePoints(1,100){}{11.444 add}
	\listplot[linecolor=red,plotNo=1,plotNoMax=4]{\ecutConv}
\end{psgraph}

\section{third example}
\psset{plotstyle=dots,lly=-.25,llx=-2.5,urx=3,ury=2}
\begin{psgraph}[Dy=10,Oy=-11.444,Ox=4]{->}(4,0)(4,-2)(14,4){9cm}{5cm}
	\psyTick(0){-11.444}
	\psyTick(2){-11.424}
	\psyTick(4){-11.404}
	\psyTick(6){-11.384}
	\pstScalePoints(1,100){}{11.444 add}
	\psset{plotNo=1,plotNoMax=3}
	\listplot[linecolor=red]{\heightEne}
\end{psgraph}
\pstScalePoints(1,1){}{}
\end{document}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20090529/1919206c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: axisLabelsPstScalePoints.pdf
Type: application/pdf
Size: 12489 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20090529/1919206c/attachment-0001.pdf>


More information about the PSTricks mailing list