PSTricks 图中数据缩放错误

PSTricks 图中数据缩放错误

考虑以下:

\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}

输出

通过上述数据,可以绘制出我想要的图形,但是我已经根据原始数据手动缩放了数据;

\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}]

我如何更改代码以获得与原始数据相同的输出?

答案1

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

顺便说一下,最小例子就很好!

相关内容