mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
added gnuplot csv example
This commit is contained in:
parent
05a9ee1f1b
commit
e3a4193f41
4 changed files with 51 additions and 0 deletions
32
math/gnuplot/draw-csv/Makefile
Normal file
32
math/gnuplot/draw-csv/Makefile
Normal file
|
@ -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
math/gnuplot/draw-csv/data.csv
Normal file
8
math/gnuplot/draw-csv/data.csv
Normal file
|
@ -0,0 +1,8 @@
|
|||
time,frequency
|
||||
1,100
|
||||
2,80
|
||||
3,10
|
||||
12,120
|
||||
4,50
|
||||
5,50
|
||||
6,50
|
|
7
math/gnuplot/draw-csv/draw-csv.tex
Normal file
7
math/gnuplot/draw-csv/draw-csv.tex
Normal file
|
@ -0,0 +1,7 @@
|
|||
\documentclass{standalone}
|
||||
|
||||
\usepackage{graphicx}
|
||||
|
||||
\begin{document}
|
||||
\input plot-tmp
|
||||
\end{document}
|
4
math/gnuplot/draw-csv/plot.gnuplot
Normal file
4
math/gnuplot/draw-csv/plot.gnuplot
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue