Martin Thoma пре 11 година
родитељ
комит
327111dded
3 измењених фајлова са 10 додато и 11 уклоњено
  1. 5 1
      tikz/lda-gauss-1/README.md
  2. BIN
      tikz/lda-gauss-1/lda-gauss-1.png
  3. 5 10
      tikz/lda-gauss-1/lda-gauss-1.tex

+ 5 - 1
tikz/lda-gauss-1/README.md

@@ -1,3 +1,7 @@
 Compiled example
 ----------------
-![Example](lda-gauss-1.png)
+![Example](lda-gauss-1.png)
+
+## Credits
+
+* [How can I make axis lines connected and make axis be over the plot?](http://tex.stackexchange.com/a/196950/5645) answered by [percusse](http://tex.stackexchange.com/users/3235/percusse)

BIN
tikz/lda-gauss-1/lda-gauss-1.png


+ 5 - 10
tikz/lda-gauss-1/lda-gauss-1.tex

@@ -11,13 +11,15 @@
 \pgfmathdeclarefunction{gauss}{2}{%
   \pgfmathparse{1/(sqrt(2*pi*#2))*exp(-((x-#1)^2)/(2*#2))}%
 }
-% to be used: \gauss(x)(mean)(variance)
+% to be used: \gauss(mean)(variance)
 
 \pgfplotsset{
 tick label style = {font=\sansmath\sffamily},
 every axis label/.append style={font=\sffamily\footnotesize},
 }
 
+% Thanks to percusse for solving problems with the axis
+
 \begin{document}
 \begin{preview}
 \tikzstyle{plotA}=[ultra thick,red!90!black]
@@ -28,7 +30,6 @@ every axis label/.append style={font=\sffamily\footnotesize},
         height=8.625cm,
         % Grid
         grid = major,
-        %grid style={thin, dashed},
         % size
         xmin= 0,     % start the diagram at this x-coordinate
         xmax= 125,   % end   the diagram at this x-coordinate
@@ -45,18 +46,13 @@ every axis label/.append style={font=\sffamily\footnotesize},
         },
         % Ticks
         tick align=inside,
-        %minor tick num=3,
         minor tick style={thick},
         scaled y ticks = false,
         xtick={40,70,80},
         ytick=\empty,
-        % yticklabel={\pgfmathparse{\tick}\pgfmathprintnumber{\pgfmathresult}},
-        % yticklabel style={
-        %     %/pgf/number format/precision=2,
-        %     /pgf/number format/fixed,
-        %     %/pgf/number format/fixed zerofill
-        %     },
         % Axis
+        axis on top,
+        axis line style = {very thick,shorten <=-0.5\pgflinewidth},
         axis lines = middle,
         axis line style = very thick,
         xlabel=$x$,
@@ -97,7 +93,6 @@ every axis label/.append style={font=\sffamily\footnotesize},
         \coordinate (a) at (axis cs:70,0.024);
         \draw[black,thick](a |- current plot begin) -- (a);
 
-
         % Add labels
        \node[plotA,above] at (axis cs:102,0.03){\Large $\mathcal{N}(80, 100)$};
        \node[plotB,above] at (axis cs:20,0.03){\Large $\mathcal{N}(40, 100)$};