[pstricks] psgraph pstScalePoints and labels

Antoine Pairet lists at pairet.be
Sat May 30 10:58:22 CEST 2009


Final thoughts...
The best solution is definitively to put dy to 1cm, as Herbert said. I
like this way of working, because it will ensure a good coherence
throughout the document. The distance between the labels will remain the
same.

However, Dy must then be equal to [(Oy size) / (real size * scaling)]

If one does a scaling like this
\pstScalePoints(1,100){}{11.444 add}
with the psgraph 
\begin{psgraph}[Oy=-11.444]{->}(4,0)(4,-2)(14,6){9cm}{5cm}

then:
Dy = [(6 - (-2)) / (5 * 100)]
   = .016


Two examples are provided below:
\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=.012,Oy=-11.444,Ox=4,dy=1cm]{->}(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=1cm,Dy=.018,Oy=-11.444]{->}(0,0)(0,-1)(90,8){9cm}{5cm}
	\pstScalePoints(1,100){}{11.444 add}
	\listplot[linecolor=red,plotNo=1,plotNoMax=4]{\ecutConv}
\end{psgraph}
\end{document}






On Sat, 2009-05-30 at 00:31 +0200, Antoine Pairet wrote:

> > \begin{psgraph}[dy=1cm,Dy=0.010,Oy=-11.444,Ox=4]{->}(4,0)(4,-2)(14,4){9cm}{5cm}
> 
> This is still not what I would like to have. However I now better
> understand how the parameters should be set.
> 
> dy should be set to 5/6 as the real size of the graph is 5cm and that
> the Oy axe is ranging from -2 to 4. The labels are thus correct only if
> dy equals the ration between the real size and the Oy size.
> 
> Those are thus correct:
> \begin{psgraph}[dy=0.833333333cm,Dy=0.010,Oy=-11.444,Ox=4]{->}(4,0)(4,-2)(14,4){9cm}{5cm}
> 
> \begin{psgraph}[dy=1cm,Dy=0.010,Oy=-11.444,Ox=4]{->}(4,0)(4,-2)(14,3){9cm}{5cm}
> 
> To summarize:
> Dy and Oy: reflects the scaling done on the real data through
> \pstScalePoints
> dy: reflects the ration between the real graphic size and the Oy axe
> length.
> 
> Herbert, as always your help is precious and accurate! Thank you very
> much!
> regards,
> Antoine 
> 
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20090530/3dfb6490/attachment-0001.html>


More information about the PSTricks mailing list