diff --git a/math/gnuplot/draw-csv/Makefile b/math/gnuplot/draw-csv/Makefile new file mode 100644 index 0000000..5dc6e06 --- /dev/null +++ b/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 diff --git a/math/gnuplot/draw-csv/data.csv b/math/gnuplot/draw-csv/data.csv new file mode 100644 index 0000000..2bd15a5 --- /dev/null +++ b/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 diff --git a/math/gnuplot/draw-csv/draw-csv.tex b/math/gnuplot/draw-csv/draw-csv.tex new file mode 100644 index 0000000..b416f35 --- /dev/null +++ b/math/gnuplot/draw-csv/draw-csv.tex @@ -0,0 +1,7 @@ +\documentclass{standalone} + +\usepackage{graphicx} + +\begin{document} +\input plot-tmp +\end{document} diff --git a/math/gnuplot/draw-csv/plot.gnuplot b/math/gnuplot/draw-csv/plot.gnuplot new file mode 100644 index 0000000..8f71d86 --- /dev/null +++ b/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