Преглед изворни кода

Make y-axis tick labels fixed precision of 2

Martin Thoma пре 9 година
родитељ
комит
23207e7040
2 измењених фајлова са 10 додато и 6 уклоњено
  1. 4 3
      tikz/sigmoid-function-2/Makefile
  2. 6 3
      tikz/sigmoid-function-2/sigmoid-function-2.tex

+ 4 - 3
tikz/sigmoid-function-2/Makefile

@@ -1,11 +1,10 @@
 SOURCE = sigmoid-function-2
 DELAY = 80
 DENSITY = 300
-WIDTH = 500
+WIDTH = 512
 
 make:
 	pdflatex $(SOURCE).tex -output-format=pdf
-	pdflatex $(SOURCE).tex -output-format=pdf
 	make clean
 
 clean:
@@ -29,4 +28,6 @@ svg:
 	#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
 	pdf2svg $(SOURCE).pdf $(SOURCE).svg
 	# Necessary, as pdf2svg does not always create valid svgs:
-	inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
+	inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
+	rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
+	rm $(SOURCE)1.svg

+ 6 - 3
tikz/sigmoid-function-2/sigmoid-function-2.tex

@@ -7,17 +7,20 @@
 \begin{document}
 \begin{tikzpicture}
     \begin{axis}[
-    	legend pos=north west,
+        legend pos=north west,
         axis x line=middle,
         axis y line=middle,
+        y tick label style={/pgf/number format/fixed,
+                            /pgf/number format/fixed zerofill,
+                            /pgf/number format/precision=1},
         grid = major,
         width=16cm,
         height=8cm,
         grid style={dashed, gray!30},
         xmin=-8,     % start the diagram at this x-coordinate
-        xmax= 8,    % end   the diagram at this x-coordinate
+        xmax= 8,     % end   the diagram at this x-coordinate
         ymin= 0,     % start the diagram at this y-coordinate
-        ymax= 1,   % end   the diagram at this y-coordinate
+        ymax= 1,     % end   the diagram at this y-coordinate
         %axis background/.style={fill=white},
         xlabel=$t$,
         ylabel=sig$(t)$,