[:de]Wie stellt man Gnuplot so ein, dass die Ausgabe in eine Datei gespeichert wird, welche Parameter beeinflussen die Ausgabe.
[:en]How do I set up Gnuplot so that the ouput will be safed to a file, what parameters influence the output.
[:][:de]
#Titel des Graphen
set title „Verbrauchsdaten Strom und Gas“
#Titel der x-Achse
set xlabel „Monat“
#Titel der y-Achse
set ylabel „Strom-/Gasverbrauch in kWh“
#Die x-Achse ist als Datum formatiert
set xdata time
#Die Daten für die x-Achse liegen im Format „06/2006“ vor
set timefmt „%m/%Y“
#Die x-Achse soll mit Monat und Jahr in der Form „Jun 06“ beschriftet werden
set format x „%b %y“
#Die y-Achse soll zwischen den „Haupttics“ 5 Unterteilungen haben
set mytics 5
#Die x-Achse soll nur die Monate 07/2005 bis 06/2006 darstellen
set xrange[„07/2005″:“06/2006“]
#Das Koordinatengitter soll hinter den geplotteten Kurven liegen
set grid back
# Die Lininestärke desHauptgitters ist 2, die des Untergitters ist 0,5
set grid mytics lw 2, lw .5
# die x-Achse hat keine Gitterlinien
set grid noxtics
# Die Daten werden als Boxen dargestellt und sind 80% breit
set boxwidth 0.8 relative
# die Boxen werden mit 25% Intensität gefüllt
set style fill solid .25
# Die Legende wird auf der linken Seite des Graphen dargestellt
set key left
# Die Ausgabe erfolgt im pdf-Format
set terminal pdf
# Die Ausgabedatei heißt „strom_und_gasverbrauch.pdf“
set output ’strom_und_gasverbrauch.pdf‘
# Die Eingabedaten liegen in der Datei „strom_und_gasverbrauch.csv“,
# für den Gasverbrauch wird Spalte 2 als x-Achse und
# Spalte 7 als y-Achse verwendet,
# in der Legende wird der erste Plot mit ‚Gasverbrauch‘ beschriftet,
# die Darstellung erfolgt als Box mit der Farbe 3
# die zweite Kurve verwendet Spalte 2 und 4, wird als Stromverbrauch
# beschriftet und ebenfalls als Box dargestellt, mit der Farbe 1
plot\
’strom_und_gasverbrauch.csv‘ u 2:7 title ‚Gasverbrauch‘ w boxes fs 3,\
’strom_und_gasverbrauch.csv‘ u 2:4 title ‚Stromverbrauch‘ w boxes fs 1[:en]
#Title of the plotdes
set title „Verbrauchsdaten Strom und Gas“
#Title of the x-axis
set xlabel „Monat“
#Title of the y-axis
set ylabel „Strom-/Gasverbrauch in kWh“
#the x-axis is formatted as a date
set xdata time
#the data format for the x-axis data is „06/2006“
set timefmt „%m/%Y“
#the label of the x-axis shall be in the form of „Jun 06“
set format x „%b %y“
#the y-axis shall have 5 subdivisions of the main tics
set mytics 5
#on the x-axis only the months 07/2005 till 06/2006 shall be displayed
set xrange[„07/2005″:“06/2006“]
#the grid shall be behind the plotted data
set grid back
#the line width of the main grid shall be 2, of the sub grid 0,5
set grid mytics lw 2, lw .5
#for the x-axis no grid is displayed
set grid noxtics
#the data will be displayed as boxes which are 80% wide
set boxwidth 0.8 relative
#the boxes will be filled with a 25% intensity
set style fill solid .25
#the legend will be displayed left of the plot
set key left
#output to pdf file
set terminal pdf
#output file will be named „strom_und_gasverbrauch.pdf“
set output ’strom_und_gasverbrauch.pdf‘
#input data is in file „strom_und_gasverbrauch.csv“,
#for Gasverbrauch column 2 is x-axis and
# column 7 isy-axis
# in legend the plot will be described as ‚Gasverbrauch‘,
# it will be display as box with color 3
# the second plot uses column 2 and 4 is labeled ‚Stromverbrauch‘
# will be displayed as box and with color 1
plot\
’strom_und_gasverbrauch.csv‘ u 2:7 title ‚Gasverbrauch‘ w boxes fs 3,\
’strom_und_gasverbrauch.csv‘ u 2:4 title ‚Stromverbrauch‘ w boxes fs 1[:]
Hallo,
habe das so gemacht wie du, nur mit meinem Problem, aber bei mir kommt als Ausgabe:
warning: Skipping unreadable file „all.csc“
no data in plot
was könnte der Fehler sein? Liegt es daran das in der Excel Tabelle über den Daten zu jeder Spalte eine Überschrift vorhanden ist?
Freue mich über Infos 🙂
Gruß Sven
all.csv statt all.csc 😉