2

I found this plot/image online. I need to change the values of the boxes a bit and I want to plot it in a better quality with PGFPlots.

enter image description here

This is the code of my attempt:

\begin{tikzpicture}
\begin{axis}[

    title={Title},
    xlabel={Voltage [V]},
    ylabel={Temperature [°C]},
    xmin=0, xmax=10,
    ymin=-15, ymax=300,
    xtick={0,2,4,6,8,10},
    ytick={0,50,100,150,200,250,300},
    legend pos=north west,
    ymajorgrids=true,
    grid style=dashed,
]
\fill [red](axis cs:0,-15) rectangle (axis cs:2.5,300);
\end{axis}
\end{tikzpicture}

Problems that came up:

  1. Scaling of the axis
  2. Label of the areas (rectangles)
  3. Grid inside the plot

Is there a way to get this three points solved within PGFPlots?

Stefan Pinnow
  • 29,535
Stani
  • 23
  • the colors are of criminal intent for colorblinds. – percusse Dec 19 '16 at 14:20
  • area 1 can be green and the rest red. The original plot is not mine – Stani Dec 19 '16 at 14:24
  • What exactly do you mean here? 2) \node [white] at (axis cs:x,y) {txt};? 3) Do you mean drawing the dashed and dotted lines? If yes, first part of http://tex.stackexchange.com/a/327983/586, combined with axis cs.
  • – Torbjørn T. Dec 19 '16 at 15:25
  • @TorbjørnT. 1) to lable the axis like in the given picture. if possible even with the borders of the operating window. – Stani Dec 19 '16 at 15:39
  • Check documentation for keywords width, height, scale only axis, and axis on top. – John Kormylo Dec 19 '16 at 19:15