Temat: Generowanie wykresów w Gnuplot
Mam taki problem z którym nie umię sobie poradzić, mianowicie mam skrypt który generuje wykresy. Na każdym wykresie są opisy temperatur max, min oraz aktualna o ile pierwszy wykres jest ok ,to następne dwa mają jakby nałożone dane min, max i aktualna na siebie( tak jakby gnuplot nakładał na siebie kilka zmiennych na nowo generowany pnd).
Poniżej skrypt:
#!/bin/sh
##### opis dla temp. zasilania CO ###############
## 1 godz.
min_t_CO_1h=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_1h.txt | sort -n | head -1 `
max_t_CO_1h=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_1h.txt | sort -n | tail -1 `
akt_CO_1h=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_1h.txt | tail -1 `## 24 godz.
min_t_CO_24h=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_24h.txt | sort -n | head -1 `
max_t_CO_24h=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_24h.txt | sort -n | tail -1 `
akt_CO_24h=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_24h.txt | tail -1 `## 7 dni
min_t_CO_7d=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_7d.txt | sort -n | head -1 `
max_t_CO_7d=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_7d.txt | sort -n | tail -1 `
akt_CO_7d=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_7d.txt | tail -1 `## miesiąc
min_t_CO_30d=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_30d.txt | sort -n | head -1 `
max_t_CO_30d=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_30d.txt | sort -n | tail -1 `
akt_CO_30d=`cut -d' ' -f3 /Meteo/temp/co_zasilanie_30d.txt | tail -1 `#####################################################
GNUPLOT_COMMAND="/tmp/gnuplot_cmd"
touch ${GNUPLOT_COMMAND}cat > ${GNUPLOT_COMMAND} << __EOF__
################ temperatura zasilania CO ########################
set terminal png small size 800,500
set output '/www1/temp_co_1h.pnd'
set title "Ostatnia godzina"
set xlabel "godzina"
set timefmt "%Y-%m-%d %H:%M:%S"
set xdata time
set autoscale
set ylabel "temperatura °C"
set format x "%H:%M"
set grid x x2 y y2 mx my mx2 my2
set key left
set label "aktualna: ${akt_CO_1h}" at graph 0.4, graph 0.97
set label "maksymalna: ${max_t_CO_1h}" at graph 0.4, graph 0.92
set label "minimalna: ${min_t_CO_1h}" at graph 0.4, graph 0.87
plot '/Meteo/temp/co_zasilanie_1h.txt' using 1:3 t 'dane rzeczywiste' with lines lt 1 lw 2;set terminal png small size 800,500
set output '/www1/temp_co_24h.pnd'
set title "Doba"
set xlabel "Godziny"
set timefmt "%Y-%m-%d %H:%M:%S"
set xdata time
set autoscale
set ylabel "temperatura °C"
set format x "%H:%M"
set grid x x2 y y2 mx my mx2 my2
set key left
set label "aktualna: ${akt_CO_24h}" at graph 0.4, graph 0.97
set label "maksymalna: ${max_t_CO_24h}" at graph 0.4, graph 0.92
set label "minimalna: ${min_t_CO_24h}" at graph 0.4, graph 0.87
set key spacing 1.3
plot '/Meteo/temp/co_zasilanie_24h.txt' using 1:3 t 'temp.wody zasilania CO' with lines lt 1 lw 2;set terminal png small size 800,500
set output '/www1/temp_co_7d.pnd'
set title "Tydzien"
set xlabel "Dzien"
set timefmt "%Y-%m-%d %H:%M:%S"
set xdata time
set autoscale
set ylabel "temperatura °C"
set format x "%d\n%H:%M"
set grid x x2 y y2 mx my mx2 my2
set key left
set label "maksymalna: ${max_t_CO_7d}" at graph 0.4, graph 0.97
set label "minimalna: ${min_t_CO_7d}" at graph 0.4, graph 0.92
set key spacing 1.3
set label "aktualna: ${akt_CO_7d}" at graph 0.4, graph 0.97
set label "maksymalna: ${max_t_CO_7d}" at graph 0.4, graph 0.92
set label "minimalna: ${min_t_CO_7d}" at graph 0.4, graph 0.87
plot '/Meteo/temp/co_zasilanie_7d.txt' using 1:3 t 'temp.wody zasilania CO' with lines lt 1 lw 2;quit
__EOF__
wdr4300