0

I would like to add a normal distribution inside a circle node using tikz package

\node[scale=4,circle, fill=blue!55!cyan!25] (Og1) at (0,0) {};

The area under the plot would be coloured if it is possible only the horizontal axis will appear without any ticks inside the node.

Dalek
  • 509

1 Answers1

1

You can use a path picture.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
 \node[circle,draw,minimum size=4cm,path picture={
 \draw[fill=blue] let 
 \p1=($(path picture bounding box.north east)-(path picture bounding box.south
  west)$)
  in plot[variable=\t,domain=-1:1,smooth] 
  ({\t*\x1/2},{exp(-\t*\t)}) |- (-\x1,0)
  (-0.5*\x1,0) edge[-stealth] (0.48*\x1,0)
   (0,0) edge[-stealth] (0,0.48*\y1);
 }]{};
\end{tikzpicture}
\end{document}

enter image description here

  • how is it possible to give the exact coordinate of the node because I have like a graph and I must define the position of the node correctly? Also how can I remove the beginning of arrow from horizontal axis? – Dalek Nov 05 '20 at 21:26
  • @Dalek The node can be place with at (0,0), say, as in your code. The arrows are due to (-0.5*\x1,0) edge[-stealth] (0.48*\x1,0) (0,0) edge[-stealth] (0,0.48*\y1), where \x1 is and \y1 are the horizontal and vertical dimension of the bounding box, and equal two times the radius for a circle. –  Nov 05 '20 at 21:40
  • I tried to resize your answer it gets messed up. – Dalek Nov 05 '20 at 21:51
  • @Dalek Too bad. You post a short code fragment, get an answer that contains a complete code, you modify the code in a way that you do not specify and then get a mess. Sorry to hear that but there is nothing I can do. –  Nov 05 '20 at 23:38