[pstricks] log-log-labeling

Poul Riis Poul.Riis at skolekom.dk
Sat Sep 3 11:40:42 CEST 2011


I think the grid in your version is misleading. Moreover, I want normal
numbers as labels, not powers of ten.

The following is rather close to what I want. (Yes, I know that you can
hardly see that it is a logarithmic plot because it's such a small
section, but i want it for principal reasons).

Again my question is: Could I make the grid and this kind of labeling
automatically?

Poul Riis


\documentclass[a4paper,12pt]{article}
\usepackage[ansinew]{inputenc} % burde der ikke være en option til denne?
\usepackage[T1]{fontenc}
\usepackage[danish]{babel}
\usepackage[x11names]{xcolor}
\usepackage{pst-func,pst-plot}
\usepackage{pstricks-add}

\begin{document}


\centering
\psset{xunit=500cm,yunit=500cm,labelFontSize=\scriptstyle}
\readdata{\datatp}{cansat_t_p.txt}
\begin{pspicture}(-0.012,-0.02)(0.01,0.002)
\psaxes[axesstyle=frame,logLines=xy,
xlogBase=10,ylogBase=10]{->}(0,0)(-0.012,-0.02)(0.01,0.002)
\psaxes[labels=none,ticks=none]{->}(0,0)(-0.012,-0.02)(0.01,0.002)
\pstScalePoints(1,1){291.76 div log}{100.92 div log}%
\listplot[dotsize=1.5pt, linecolor=Green3,
plotstyle=dots,nStart=1,nEnd=123]{\datatp}%
\listplot[dotsize=1.5pt, linecolor=Blue2,
plotstyle=dots,nStart=124,nEnd=149]{\datatp}%
\listplot[dotsize=1.5pt, linecolor=Red3,
plotstyle=dots,nStart=150,nEnd=197]{\datatp}%
\listplot[dotsize=1.5pt, linecolor=Magenta1,
plotstyle=dots,nStart=198,nEnd=232]{\datatp}%
\begin{psclip}{\psframe(-0.012,-0.02)(0.01,0.002)}
\psplot[linecolor=Yellow1,plotpoints=2]{-0.01}{0.01}{x 5.2575447 mul}
\end{psclip}
\uput{3pt}[90]{0}(0.008,0){\small $T/T_0$}
\uput{3pt}[180]{0}(0,0.0015){\small $p/p_0$}
\multido{\nny=0.98+0.01}{5}{%
\psline[linecolor=Orange1,linewidth=0.1pt](!\nny\space log 0.02
neg)(!\nny\space log 0.002)
\psline(!\nny\space log 0)(!\nny\space log 0.0002 neg)
\uput{3pt}[270]{270}(!\nny\space log 0){\small $\nny$}%
}
\multido{\nnx=0.96+0.01}{4}{%
\psline[linecolor=Orange1,linewidth=0.1pt](!0.012 neg \nnx\space
log)(!0.01 \nnx\space log)
\psline(!0 \nnx\space log)(!0.0002 \nnx\space log)
\uput{3pt}[0]{0}(!0 \nnx\space log){\small $\nnx$}%
}
\pnode(!1.005 log 0.995 log){Pop}
\pnode(!1.005 log 0.965 log){Qop}
\pnode(!0.988 log 0.965 log){Pned}
\pnode(!0.988 log 0.995 log){Qned}
\ncline[linecolor=Green3, arrows=->]{Pop}{Qop}
\naput[labelsep=0.1,npos=0.5,nrot=:U]{\color{Green3}\small Ascending}
\ncline[linecolor=Red2, arrows=->]{Pned}{Qned}
\naput[labelsep=0.1,npos=0.5,nrot=:U]{\color{Red2}\small Descending}
\end{pspicture}
\end{document}

\psset{xunit=500cm,yunit=500cm,labelFontSize=\scriptstyle}
\readdata{\datatp}{cansat_t_p.txt}
\begin{pspicture}(-0.012,-0.02)(0.01,0.002)
\psaxes[axesstyle=frame,logLines=xy, xlogBase=10,ylogBase=10,
Dx=0.01,Dy=0.01,xticksize=-0.02 0.002, xsubticksize=1,yticksize=-0.012
0.01,ysubticksize=1, subticks=10, tickcolor=Orange3,
subtickcolor=Orange1]{->}(0,0)(-0.012,-0.02)(0.01,0.002)
\psaxes[labels=none,ticks=none]{->}(0,0)(-0.012,-0.02)(0.01,0.002)
\pstScalePoints(1,1){291.76 div log}{100.92 div log}%
\listplot[dotsize=1.5pt, linecolor=Green3, plotstyle=dots]{\datatp}%
\begin{psclip}{\psframe(-0.012,-0.02)(0.01,0.002)}
\psplot[linecolor=Red2,plotpoints=2]{-0.01}{0.01}{x 5.2575447 mul}
\end{psclip}
\uput{3pt}[270]{0}(0.008,0){\small $\log(T/T_0)$}
\uput{3pt}[0]{0}(0,0.0015){\small $\log(p/p_0)$}
\end{pspicture}
\end{document}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20110903/3a26c946/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cansat_t_p.txt
URL: <http://tug.org/pipermail/pstricks/attachments/20110903/3a26c946/attachment.txt>


More information about the PSTricks mailing list