0

I'm trying to plot a std normal distribution filled to a certain point $z_\alpha$, the problem is that \tkzPointShowCoord label doesn't appear in the plot, the following is the code i used:

\newcommand\gauss[2]{1/(sqrt(2*pi*#2))*exp(-((x-#1)^2)/(2*#2))} % normal random variable

\begin{tikzpicture}[scale=0.7] \begin{axis}[every axis plot post/.append style={ mark=none,domain=-3:3,samples=50,smooth, very thick}, axis x line=bottom, % no box around the plot, only x and y axis axis y line=left, % the * suppresses the arrow tips enlargelimits=upper, legend style={draw=none, nodes={scale =.8}, at={(1.7,1.2)}}, legend cell align={left}] % extend the axes a bit to the right and top \addplot[smooth,blue, name path=f]{\gauss{0}{1}}; \path [name path=xaxis] (\pgfkeysvalueof{/pgfplots/xmin},0) -- (\pgfkeysvalueof{/pgfplots/xmax},0); \addplot[red!10, opacity=0.8] fill between [of=f and xaxis, soft clip={domain=-5:1}]; \tkzDefPoint(1,.2419){L} \tkzPointShowCoordnoydraw=true, xlabel=$z_\alpha$ \legend{$\mu =0~ \sigma^2 = 1$} \end{axis} \end{tikzpicture}

Thanks in advance for any help

  • You don't need tkz-euclide to do this. This package concerns Euclidean geometry. and with tkz-euclide 4 you can't do this. You need to use pgfplots or perhapstikz. I don't know how to use `pgfplots' but the problem here is to find the units used by 'pgfplots'. – Alain Matthes Jan 06 '22 at 22:29

1 Answers1

0

I found the answer in another post Hidden or Misplaced Node Labels when using Tikz Graphics Package

basically I had to add the label using \node and add clip=false in the style section.