等間隔座標をPGFPlotする

等間隔座標をPGFPlotする

指定された x 座標が同じ距離で視覚的に分離されるプロットを作成するにはどうすればよいですか。

つまり、0 500 1000 1500 2000の代わりに

0 10 20 50 100 200 ...

2 つ目は、y ラベルと y 座標が重なっているのですが、ラベルをさらに外側に移動するにはどうすればよいでしょうか。

\begin{tikzpicture}
    \begin{axis}[
        xlabel=Züge(\#),
        ylabel=Zeit(s)]
    \addplot[color=red,mark=x] coordinates {
        (10,25)
        (20,12)
        (50,33)
        (100,1800)
        (200,1800)
        (500,1800)
        (1000,509)
        (2000,1514)
    };
    \end{axis}
\end{tikzpicture}

答え1

ユーザー定義の目盛りと目盛りラベルと組み合わせて対数スケールを使用します。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
  \begin{semilogxaxis}[
    xlabel=Züge(\#),
    ylabel=Zeit(s),
    xtick=\empty,
    extra x ticks={10,20,50,100,200,500,1000,2000},
    extra x tick labels={10,20,50,100,200,500,1000,2000}]
    \addplot[color=red,mark=x] coordinates {
      (10,25)
      (20,12)
      (50,33)
      (100,1800)
      (200,1800)
      (500,1800)
      (1000,509)
      (2000,1514)
    };
  \end{semilogxaxis}
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

関連情報