6

I plotted a contour/surface plot with gnuplot using set pm3d map and want to include this picture via \addplot graphics {...};.

When I match the plot area of the axis environment with the plot range of the gnuplot picture, the ticks from pgfplots are "behind" the plot and thus not visible anymore.

Is there a possibility, to draw the coordinate system in the foreground, or do I have to turn the ticks to the outside of the plot?


The relevant part of the code should be:

\begin{tikzpicture}
  \def\w {0.4*\textwidth};
  \begin{axis}[
      scale only axis,
      width = \w,
      height = \w,
      xmin = 0.4,
      xmax = 0.9,
      ymin = -22.5,
      ymax = 202.5,
      scaled ticks = false,
      xtick = {0.4,0.5,0.6,0.7,0.8,0.9},
      xticklabels = {0.4,0.5,0.6,0.7,0.8,0.9},
      xlabel = $\omega/\omega_p$,
      ytick = {0,45,...,180},
      yticklabels = {$0$,$\frac{\pi}{4}$,$\frac{\pi}{2}$,$\frac{3\pi}{4}$,$\pi$},
      ylabel = angle $\varphi$ around center of sphere
      ]
    \addplot graphics[
        xmin = 0.4,
        xmax = 0.9,
        ymin = -45,
        ymax = 225,
        xtick = {0.4,0.5,0.6,0.7,0.8,0.9},
        ] {data/half.png};
  \end{axis}
\end{tikzpicture}
1
  • That's it! Thanks. Would you convert your comment to an answer, so that I can accept it?
    – Stefan
    Commented Jul 25, 2013 at 11:47

1 Answer 1

8

PGFPlots have both a layering system and a drawing order system. The option axis on top draws the axis lines and ticks over the graph area.

You must log in to answer this question.

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