1

Consider the following:

\documentclass{article}

\usepackage{pst-coil,pstricks-add}
\usepackage{siunitx}

\DeclareSIUnit[mode = text]\kroner{kr.}

\begin{document}

\begin{figure}
\savedata{\data}[{0,2.5},{0.01,2.505},{0.02,2.51},{0.03,2.515},{0.04,2.52},{0.05,2.525},{0.1,2.55},{0.5,2.75},{1,3},{2,3.5},{3,4},{4,4.5},{5,5},{6,5.5},{7,6},{8,6.5},{9,7},{10,7.5},{11,8},{12,8.5},{13,9},{14,9.5},{15,10},{16,10.5}]
 \psset{unit = 0.5}
  \begin{pspicture}(-1.8,-1.1)(21.4,12.5)
    \psaxes[
      yAxis = false,
      labels = none,
      ticklinestyle = dotted,
      tickwidth = 0.5pt,
      xticksize = 0 11
    ]{->}(0,0)(-0.4,0)(17.5,0)[$d$~(\SI{1000}{\km}),0][,90]
    \psaxes(0,0)(-0.4,0)(17.5,0)[,0][,90]
    \psaxes[
      xAxis = false,
      ticks = none,
      labels = none,
    ](0,-0.4)(0,0.5)
    \pszigzag[
      coilarm = 0.0625,
      coilwidth = 0.3,
      coilheight = 0.5
    ](0,0.5)(0,1.5)
    \psaxes[
      xAxis = false,
      labels = none,
      ticklinestyle = dotted,
      tickwidth = 0.5pt,
      yticksize = 0 17
    ]{->}(0,2)(0,1.5)(0,11.5)[,0][$O$~(\SI{1000}{\kroner}),90]
    \psaxes[
      xAxis = false,
      Oy = 9
    ]{->}(0,2)(0,1.5)(0,11.5)[,0][,90]
    \small
    \psline[
      linecolor = orange
    ](0,2.5)(17,11)
    \uput[0](17,11){Gustav}
    \psline[
      linecolor = teal
    ](0,4.5)(!17 61 6 div)
    \uput[0](!17 61 6 div){Malte}
    \dataplot[
      plotstyle = dots,
      dotstyle = o,
      fillcolor = blue
    ]{\data}
   \psset{
     linestyle = dashed
   }
    \psline(0,10)(15,10)(15,0)
    \psline(0,9.5)(15,9.5)
  \end{pspicture}
\end{figure}

\end{document}

output

With the data above, the plot is as I want it but I've scaled the data manually from the original data;

\savedata{\data}[{0,9500},{10,9505},{20,9510},{30,9515},{40,9520},{50,9525},{100,9550},{500,9750},{1000,10000},{2000,10500},{3000,11000},{4000,11500},{5000,12000},{6000,12500},{7000,13000},{8000,13500},{9000,14000},{10000,14500},{11000,15000},{12000,15500},{13000,16000},{14000,16500},{15000,17000},{16000,17500}]

How do I change the code to get the same output with the original data?

1 Answer 1

2
\pstScalePoints(1,1){1000 div}{1000 div 7 sub}
\listplot[plotstyle=dots, dotstyle=o,fillcolor=blue]{\data}

and, by the way, minimal examples may be fine!

2
  • Thank you for the answer and sorry for not making the question minimal. When do I have to use \dataplot and when do I have to use \listplot? Oct 14, 2014 at 16:51
  • 1
    \dataplot uses internally the structure <val> D <val> D ... The PS function D can be used for internal data manipulation which is not often needed. listplot can this also by using \pstScalePoints
    – user2478
    Oct 14, 2014 at 16:58

You must log in to answer this question.

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