[pstricks] logLines and ticklines

jmpapy Jean-Michel.Papy at esat.kuleuven.ac.be
Sun Jul 11 20:52:35 CEST 2004


Quoting Herbert Voss <Herbert.Voss at alumni.tu-berlin.de>:

> jmpapy wrote:
> 
> > when using the x or y-axis logarithmic scale (i.e. by setting 
> > ylogBase=10 for instance), it is possible to draw 5 lines per
> decades by 
> > also specifying logLines=y. 
> > 
> > 1. I wonder whether there is a way to modify this line density 
> > (10/decades, 20/decades...) 
> > 
> > 2. If I also want to draw the x lines (on the same graph), I write
> 
> > ticklines=x.  But unfortunately, the x-lines are shifted to the
> bottom 
> > and...overlap my caption text. Where does this offset come from ? 
> 
> please give an example file.
> 

Sorry, here is an example:
\documentclass[a4paper,10pt]{article}
\usepackage[thinlines]{easybmat}
\usepackage{rotating,graphicx,psfrag}
\usepackage{pstricks,pst-node,pst-plot,pstricks-add}
\usepackage{psfrag}
\usepackage{amsmath,amsfonts, amssymb}
\usepackage{multirow}
\newcommand{\bs}{\boldsymbol}
\newcommand{\addots}{\mbox{\raisebox{-.2em}{\reflectbox{$\ddots$}}}}
\newcommand{\Addots}{\mbox{\raisebox{-.2em}{\reflectbox{$\ddots$}}}}
\newcommand{\nms}{\negmedspace}
\newcommand{\wh}{\widehat}
\newcommand{\wt}{\widetilde}
\newcommand{\ph}{\phantom}
% macro for the plots
\makeatletter
\def\pst at scaleX{1 } % scaling the data recors
\def\pst at scaleY{1 }
\def\pst at PSopX{} % additional PostScript code
\def\pst at PSopY{}
\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 {
      \pst at PSopY\space y mul \pst at scaleY\space mul m 1 roll
      \pst at PSopX\space x mul \pst at scaleX\space mul m 1 roll
      /m m 2 sub
      def } repeat>
\makeatother
\begin{filecontents}{mydata.dat}
1 0.001
2 0.01
3 0.1
4 1
5 10
6 100
7 1000
8 10000
\end{filecontents}
\begin{document}
\begin{figure}
\begin{center}
\psset{xunit=1cm,yunit=1cm,xyLabel={\scriptsize\sffamily}}
\begin{pspicture}[0.5](1,-3)(8,4)
\psaxes[linewidth=0.5pt,axesstyle=frame,Dx=1,Ox=1,Oy=-3,ylogBase=10,
logLines=y,tickstyle=top](1,-3)(8,4)
\readdata{\data}{mydata.dat}
\makeatletter\def\pst at PSopY{log}\makeatother %log of y-scale
\listplot[linecolor=blue,linewidth=0.5pt,showpoints=true,dotstyle=o]
{\data}
\makeatletter\def\pst at PSopY{1 }\makeatother %return to linear scale
\end{pspicture}
\end{center}
\caption{What a nice line !}
\end{figure}
\end{document}

Thus my first question is : how to have more than 5 lines per decades on 
the y-axix ?


Now recompile it adding ticklines=x in the \psaxes options, and you'll 
see that the x-lines have an offset to the bottom. So my second question 
is: how to avoid it ?

Let me know if this example is not clear enough. 

thank you again

JM

  
> Herbert
> 
> 
> 
> -- 
> http://TeXnik.de/
> http://PSTricks.de/
> ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
> http://www.dante.de/faq/de-tex-faq/
> http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
> 
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> 






More information about the PSTricks mailing list