0

I have this setup:

\begin{axis}[
    ybar,
    ylabel near ticks,
    bar width=.005cm,
    width=\textwidth,
    height=3.5cm,
    xmin = 0,
    xmax = 200,
    ymin = 0,
    xtick distance = {10},
    xlabel={Latency in $\mu$s},
    ylabel = {Amount}],
    \addplot[
      draw={rgb:red,171;green,12;blue,39},
      fill={rgb:red,171;green,12;blue,39}
    ] table [
        x={LATENCY},
        y={AMNT},
        restrict expr to domain={y}{1:65535}
      ]{\datatable};
    \addlegendentry{AF-XDP}

    \addplot[mark=none, draw=blue, fill=blue] coordinates {
      (7, 0)
      (7, 1500)
    };
    \addlegendentry{Median};

    \addplot[mark=none, draw=green, fill=green] coordinates {
      (7, 0)
      (7, 1500)
    };
    \addlegendentry{Mean};
\end{axis}

But for whatever reason, the second and third plot (coordinates) are moved right on the x-axis. This is especially noticable, because the second and third plot have the same coordinates but they are not displayed on the same x-Position. Is there a way to prevent that?

Thiis

  • 2
    Always nicer if you make complete examples, with the necessary data included. Related, I think: https://tex.stackexchange.com/questions/43832/how-can-i-create-bar-plot-groups-of-different-sizes-in-pgfplots – Torbjørn T. Apr 03 '20 at 14:43
  • @TorbjørnT. Yes, bar shift = 0 did the trick, thank you! – binaryBigInt Apr 03 '20 at 14:58

0 Answers0