When you use gnuplot in TikZ, all that happens is that you get gnuplot to generate a series of points in a table that is read and rendered using TikZ. The histeps
option doesn't change the data, but only the rendering (in gnuplot), so it doesn't influence what you see in TikZ. Instead, you can use the TikZ option const plot
:
\draw[black,thick] plot[id=gg,raw gnuplot, const plot] function{
set xrange [0:7.5];
set samples 30;
normal(x,mu,sigma)=sigma<=0?1/0:invsqrt2pi/sigma*exp(-0.5*((x-mu)/sigma)**2);
invsqrt2pi = 0.398942280401433;
plot 3.5*normal(x,1.5,0.5);
};
I am not sure if this is what you want, but I would suggest you to use the pgfplots
package (internally uses TikZ); a little example (the solid and hollow dot styles are borrowed from a comment by cmhughes):
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.6}
\pgfplotsset{soldot/.style={color=blue,only marks,mark=*}} \pgfplotsset{holdot/.style={color=blue,fill=white,only marks,mark=*}}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot[domain=0:4,blue] {x*x};
\addplot[domain=4:6,blue] {x};
\addplot[domain=6:10,blue] {-5};
\draw[dotted] (axis cs:4,16) -- (axis cs:4,4);
\draw[dotted] (axis cs:6,6) -- (axis cs:6,-5);
\addplot[holdot] coordinates{(0,0)(4,4)(6,-5)};
\addplot[soldot] coordinates{(4,16)(6,6)(10,-5)};
\end{axis}
\end{tikzpicture}
\end{document}
Best Answer
Fixed the exponent typo now it is behaving properly.