2

Consider the following example:

Code

% pdflatex -shell-escape test.tex

\documentclass{article}

\usepackage{auto-pst-pdf,pst-plot}

\def\seere#1#2#3{%
  \pspolygon[%
    fillstyle=solid,%
    fillcolor=red!45
  ](!2 #1 mul 1 sub \bredde 2 div sub 0)%
   (!2 #1 mul 1 sub \bredde 2 div sub #2)%
   (!2 #1 mul 1 sub \bredde 2 div add #2)%
   (!2 #1 mul 1 sub \bredde 2 div add 0)
  \rput(!2 #1 mul 1 sub #2 5 add){\scriptsize #2\,000}
  \rput{90}(!2 #1 mul 1 sub #2 2 div){\scriptsize #3\,\%}
}

\begin{document}

\def\bredde{0.7 }
\centering
\psset{xunit=0.6cm,yunit=0.042cm}
\begin{pspicture}(21,240)
 \psaxes[
   mathLabel=false,% This removes the math mode on both axes.
   xLabels={%
    ,Nord,%
    ,Midt-Vest,%
    ,{\O}stjylland,%
    ,Syd,%
    ,Fyn,%
    ,{\O}st,%
    ,Bornholm,%
    ,Lorry,%
   },%
   xLabelsRot=90,%
   Dy=2,%
   dy=20,%
   ticks=y,%
   ylabelFactor={\cdot 10^4}%
 ]{->}(0,0)(16,230)[Tv-stationer,0][Seere,90]
 \multido{\i=20+20}{11}{\psline[linestyle=dotted](0,\i)(16,\i)}
 \seere{1}{86}{9.8}
 \seere{2}{87}{9.9}
 \seere{3}{107}{12.2}
 \seere{4}{147}{16.7}
 \seere{5}{102}{11.6}
 \seere{6}{125}{14.2}
 \seere{7}{16}{1.8}
 \seere{8}{210}{23.9}
\end{pspicture}

\end{document}

Output

output

Question

How do I get the x-axis in text mode and the y-axis in math mode?

I have had a look at section 9.8 in the pst-plot manual but I'm not sure how to redefine \pshlabel and \psvlabel.

P.S. I might not look at this again before tomorrow or even Monday.

1 Answer 1

2

use

[...]
\begin{pspicture}(21,240)
 \psaxes[
   xAxis=false,%%%%%%%%%
   Dy=2,%
   dy=20,%
   ticks=y,%
   ylabelFactor={\cdot 10^4}]{->}(0,0)(16,230)
 \psaxes[
   mathLabel=false,
   yAxis=false,%%%%%%%%%%%%
   xLabels={%
    ,Nord,%
    ,Midt-Vest,%
    ,{\O}stjylland,%
    ,Syd,%
    ,Fyn,%
    ,{\O}st,%
    ,Bornholm,%
    ,Lorry,%
   },%
  xLabelsRot=90,
 ]{->}(0,0)(16,230)[Tv-stationer,0][Seere,90]
[...]
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .