Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
That's it! Thanks. Would you convert your comment to an answer, so that I can accept it? –  Stefan Jul 25 '13 at 11:47
add comment

1 Answer

up vote 6 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.