소스 검색

added gnuplot csv example

Martin Thoma 12 년 전
부모
커밋
e3a4193f41
4개의 변경된 파일51개의 추가작업 그리고 0개의 파일을 삭제
  1. 32 0
      math/gnuplot/draw-csv/Makefile
  2. 8 0
      math/gnuplot/draw-csv/data.csv
  3. 7 0
      math/gnuplot/draw-csv/draw-csv.tex
  4. 4 0
      math/gnuplot/draw-csv/plot.gnuplot

+ 32 - 0
math/gnuplot/draw-csv/Makefile

@@ -0,0 +1,32 @@
+SOURCE = draw-csv
+DELAY = 80
+DENSITY = 300
+WIDTH = 500
+
+make:
+	gnuplot plot.gnuplot
+	pdflatex $(SOURCE).tex -output-format=pdf
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux plot-tmp.tex
+
+gif:
+	pdfcrop $(SOURCE).pdf
+	convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
+	make clean
+
+png:
+	make
+	make svg
+	inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
+
+transparentGif:
+	convert $(SOURCE).pdf -transparent white result.gif
+	make clean
+
+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

+ 8 - 0
math/gnuplot/draw-csv/data.csv

@@ -0,0 +1,8 @@
+time,frequency
+1,100
+2,80
+3,10
+12,120
+4,50
+5,50
+6,50

+ 7 - 0
math/gnuplot/draw-csv/draw-csv.tex

@@ -0,0 +1,7 @@
+\documentclass{standalone}
+
+\usepackage{graphicx}
+
+\begin{document}
+\input plot-tmp
+\end{document}

+ 4 - 0
math/gnuplot/draw-csv/plot.gnuplot

@@ -0,0 +1,4 @@
+set terminal latex
+set output "plot-tmp.tex"
+set datafile separator "," 
+plot 'data.csv' every::1::7  using 1:2 with lines