# Create a Shmoo plot with pgfplots/tikz

I'm interested in creating a Shmoo-plot using LaTeX. I have looked through the PGFplot-examples but couldn't find any that looked suitable as a starting template. Google produces nothing as well, and I don't wish to abuse Excel for obvious non-pretty reasons (although it is very easy for this kind of plot).

If a Shmoo-plot is unfamiliar to you, it is a two dimensional (presented as such at least) discrete plot looking something like this:

What I want to produce like the image above, although without the pass/fail text. Do you have any suggestions on how I should approach the problem? Sorry if this is a very simple question, I am a beginner in PGFplots and might have missed an easy solution.

edit: this is a more accurate image of what I'm trying to reproduce. This is almost exactly the style I'm looking for.

the input data formatting can be changed to fit any solution, so it is not considered a problem. For example, it can be (x, y, p/f) such as a simple four point set:

(1, 10, 1) (1, 11, 0) (2, 10, 1) (2, 11, 0)

• This could be something that can be easily coded for TikZ direct (e.g. a \matrix) or even a simple tabular. Especially if the x and y values are discrete like that. How does the input look like? – Qrrbrbirlbel Jul 2 '13 at 0:43
• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format – texenthusiast Jul 2 '13 at 0:54
• After reconsidering this might be something for the mesh or the surf plot, though it seems the colors of the z values are assigned to an area between coordinates and not an area around coordinates. – Qrrbrbirlbel Jul 2 '13 at 2:58
• This could be a duplicate of tex.stackexchange.com/questions/73640/… – Christian Feuersänger Jul 2 '13 at 18:20
• This could also be a duplicate of this question. – Tom Bombadil Jul 17 '13 at 13:01

## 1 Answer

Finally got a result I was satisfied with, and I'm answering this to help any other poor EE-engineer if they get stuck with the same thing. This is a simple solution compared to the ones discussed in the comments.

\documentclass{article}
\usepackage{pgfplots, amsmath}
\pgfplotsset{compat=newest}
\pgfplotsset{major grid style={color=black}, minor grid style={color=black}}
\pgfplotsset{every  tick/.style={black,}}

\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=7.5,
xmax=52.5,
ymin=0,
axis on top,
tick align=outside,
tickpos=left,
xtick=data,
minor xtick={7.5,12.5,...,55},
ytick={0,0.2,...,2.5},
minor ytick={0.1,0.2,...,2.4},
enlargelimits=false,
axis background/.style={fill=green!30},
yminorgrids,
ymajorgrids,
xminorgrids,
xlabel=Frequency (MHz),
ylabel=V$_{\text{DD}}$ (V)]
\addplot
[const plot mark mid,fill=red!30]
coordinates
{
(5,0.7)
(10,0.8)
(15,0.9)
(20,1)
(25,1.1)
(30,1.2)
(35,1.3)
(40,1.4)
(45,1.5)
(50,1.6)
(55,1.7)
}
\closedcycle;

\end{axis}
\end{tikzpicture}
\end{document}