[pstricks] logarithmic scale

jmpapy Jean-Michel.Papy at esat.kuleuven.ac.be
Mon Jul 5 00:59:25 CEST 2004



Hello,

I plotted some data using pstricks in linear scale. Here are the code 
and the data: 
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{pst-plot}
\input pst-axes
\usepackage{pstricks-add}
\begin{document}

\begin{figure}
\psset{xunit=3cm, yunit=1cm,xLabel={\scriptsize\sffamily}, 
yLabel={\scriptsize\sffamily}}
\begin{pspicture}[](-0.5,-1)(3,9)
%\psframe(-0.5,-1)(3,9)
\psaxes[axesstyle=frame,Dx=0.5](2.8284,8.2287)
\rput(1.5,-0.8){Noise Standard Deviation}
\rput{90}(-0.3,4){\small\sffamily RRMSE [\%]}
\fileplot[linewidth=0.5pt]{sv1_2_5.dat}
\end{pspicture}
\end{figure}
\end{document} 

    0.1414    0.0052
    0.2828    0.0217
    0.4243    0.0480
    0.5657    0.0890
    0.7071    0.1375
    0.8485    0.1906
    0.9899    0.2663
    1.1314    0.3580
    1.2728    0.4644
    1.4142    0.5801
    1.5556    0.7033
    1.6971    0.8899
    1.8385    1.1143
    1.9799    1.2593
    2.1213    1.5692
    2.2627    3.2331
    2.4042    4.4097
    2.5456    5.8186
    2.6870    7.4441
    2.8284    8.2287 

Now I would want to plot the same data in decimal log scale (for the y 
axis). 
So I used \readdata and added 
\makeatletter
\pst at def{ScalePoints}<%
   /y ED /x ED
   counttomark dup dup cvi eq not { exch pop } if
   /m exch def /n m 2 div cvi def
   n {
      y mul log m 1 roll % <-- log of y
      x mul m 1 roll
      /m m 2 sub
      def } repeat>
\makeatother

but the result does not look as expected. I attached an .eps picture 
which show you how it should look.

thank you for any help

JM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sv1_2_5.eps
Type: application/postscript
Size: 14696 bytes
Desc: not available
Url : http://tug.org/pipermail/pstricks/attachments/20040705/56a90a6e/attachment.eps 


More information about the PSTricks mailing list