Graphics, Figures & TablesAxes grid on top of the pin when using gnuplot

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mgulin
Posts: 18
Joined: Thu May 31, 2012 7:16 pm

Axes grid on top of the pin when using gnuplot

Post by mgulin »

Hi all!

I've encountered a strange behaviour when using a contour gnuplot, where the axes grid is on top of the pin (please see the image below).
problem.png
problem.png (12.89 KiB) Viewed 3021 times
Here is the code I used:

Code: Select all

\documentclass[10pt]{IEEEtran}

\usepackage{pgfplots}

\usepackage[active,pdftex,tightpage]{preview}
\PreviewEnvironment[{[]}]{tikzpicture}

\pgfplotsset{%
	compat=newest,
	width=0.85\columnwidth,
	height=3.15cm,
	scale only axis,
	grid=both,
	grid style={dashed,gray},
	grid style={on layer=axis background},
	y label style={at={(-0.075,0.5)}},
}

\tikzset{small dot/.style={fill=black, circle,scale=0.25}}
\tikzset{every pin/.style={draw=black, fill=yellow!10, fill opacity=1}}

\begin{document}

\begin{tikzpicture}[scale=1]
\begin{axis}[
	xlabel={},
	ylabel={},
	xmin=0,
	xmax=400,
	xtick={0,50,...,400},
	ymin=1,
	ymax=2,
	ytick={1,1.2,...,2},
	font=\footnotesize,
	view={0}{90},
]
\addplot3 [contour gnuplot={number=90, labels=false}, mesh/ordering = y varies, mesh/rows=101, mesh/cols=101] file {data.txt} ;
\node[coordinate, small dot, pin=60:{$0.054$ W}] at (axis cs:229,1.3) {} ;
\end{axis}
\end{tikzpicture}

\end{document}
Please find attached the file data.txt.

Best,
Marko.
Attachments
data.zip
(39.5 KiB) Downloaded 132 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
mgulin
Posts: 18
Joined: Thu May 31, 2012 7:16 pm

Axes grid on top of the pin when using gnuplot

Post by mgulin »

I finally managed to find a solution.

Just add the command set layers inside axis options.

Best,
Marko.
Post Reply