[pstricks] log-log-plot
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Wed Feb 6 10:22:45 CET 2008
Poul Riis schrieb:
> Is there a way to make a log-log-plot more automatically than in the
> example below? And make it look more closely identical to the well-known
> log-log-paper?
not really,
but you can define some helpful macros
Herbert
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames,svgnames,x11names]{pstricks}
\usepackage{pstricks-add}
\usepackage{geometry}
\geometry{tmargin=1cm,textwidth=17.0cm,textheight=25.5cm,headheight=15pt}
\newcommand{\loglogplot}[4]{\pscircle*[linecolor=#4](!#1 log #2 log){#3pt}}
\newcommand{\loglogplotlabeled}[5]{\pscircle*[linecolor=#4](!#1 log #2
log){#3pt}\uput{5pt}[0](!#1 log #2 log){\color{#4}#5}}
\pagestyle{empty}
\parindent=0em
\def\xUPut#1{\uput{3pt}[270](!#1 log 0){#1}}
\def\yUPut#1{\uput{3pt}[180](!1 neg #1 log){#1}}
\begin{document}
\begin{center}
\psset{unit=4cm}
\pspicture(-1.15,-0.15)(1,3)
\psaxes[linecolor=red,logLines=all,xticksize=0 3, yticksize=0 2,
subticksize=1,xylogBase=10,tickcolor=Red3,subtickcolor=Red1,
tickwidth=1pt,subticks=10,labels=none](-1,0)(1,3)
\tiny
\multido{\nA=1+1,\nB=10+10,\nC=100+100}{6}{%
\yUPut{\nA}\yUPut{\nB}\yUPut{\nC}}
\psforeach{\nA}{8, 80, 800, 1000}{\yUPut{\nA}}
%
\multido{\nA=1+1}{6}{\xUPut{\nA}}
\multido{\nA=0.2+0.2}{4}{\xUPut{\nA}}
\psforeach{\nA}{0.1, 8, 10}{\xUPut{\nA}}
%
\footnotesize
\uput{3pt}[270](!1 log 0.1 neg){Radius of orbit (mill. km)}
\uput{18pt}[180]{90}(!0.1 log 50 log){Siderical time of revolution (days)}
\loglogplotlabeled{0.422}{1.76914}{2.0}{Green1}{Io}
\loglogplotlabeled{0.671}{3.55118}{2.0}{Green2}{Europa}
\loglogplotlabeled{1.070}{7.15455}{2.0}{Green3}{Ganymede}
\loglogplotlabeled{1.883}{16.68902}{2.0}{Green4}{Callisto}
\endpspicture
\end{center}
\end{document}
More information about the PSTricks
mailing list