[Tex/LaTex] Pgfplots/TikZ: plot positive half of axis only

axispgfplots

How can I tell pgfplots to show only the positive half of one axis, whilst still plotting the data points that fall on the negative half of that axis? E.g., with reference to this figure,

enter image description here

I would like to plot only the right side of the x-axis (>0), without altering anything else. So far, all my attempts have cropped the left side of the figure altogether.

Thanks in advance!

EDIT:

Here's an example of a MWE:

\documentclass[11pt,onecolumn]{article}
\usepackage{pgfplots}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[%
    axis on top, scale only axis,
    xmin=-22.55, xmax=22.55,
    xlabel={$r/b_0$},
    ymin=0., ymax=54.05,
    ylabel={$z/b_0$},
    axis lines=center,
    xtick=\empty, ytick=\empty,
    ]
    \addplot [forget plot] graphics [xmin=-22.55, xmax=22.55, ymin=0.05, ymax=54.05] {foo.png};
    \end{axis}
\end{tikzpicture}%

\end{document}

I've removed the code for calculating the black outline, which is long. The above MWE leads to (sorry for the quality):

Figure 2

Attempts like axis x line=right or xmin=0 lead to

enter image description here

and

figure 4, respectively.

Best Answer

One possibility would be to disable the drawing of the x-axis, and draw it manually afterwards. There are probably other possible approaches as well.

output of code

\documentclass[11pt,onecolumn]{article}
\usepackage{pgfplots} % loads tikz
\begin{document}    
\begin{tikzpicture}
    \begin{axis}[%
    axis on top, scale only axis,
    xmin=-22.55, xmax=22.55,
    xlabel={$r/b_0$},
    ymin=0., ymax=54.05,
    ylabel={$z/b_0$},
    axis lines=center,
    xtick=\empty, ytick=\empty,
    x axis line style={draw=none}, % disable drawing of x-axis
    clip=false % disable clipping
    ]
    % added opacity=0.1 only to make the result clearer
    \addplot [forget plot,opacity=0.1] graphics [xmin=-22.55, xmax=22.55, ymin=0.05, ymax=54.05] {example-image};

    % draw axis line
    \draw [/pgfplots/every inner x axis line, draw=black, line cap=rect] (axis cs:0,0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax}, 0);

    \end{axis}
\end{tikzpicture}%

\end{document}