I forgot to change the textcolor. (Also, there was a typo which I have fixed as well.)
- Code: Select all
#! /usr/bin/env gnuplot
# -*- coding: utf-8 -*-
reset
set terminal pngcairo enhanced background "#000000" font "Lato-Light,9" linewidth 1 rounded size 600,200
set output "/Users/TV/10DayForecast.png"
dataFileForecast = "/Users/TV/10DayForecast.csv"
set datafile separator ','
set timefmt "%Y-%m-%d"
stats dataFileForecast using 2:4 nooutput
freezeWarning = 32.
Yhigh = STATS_max_x + 10.
Ylow = STATS_min_y - 10.
freezeLabel = ((freezeWarning-Ylow) / (Yhigh-Ylow))
unset key
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set style fill transparent solid 0.4
set style line 1 linetype rgb "#0066CC"
set style line 2 linetype rgb "#FFFFFF" pointtype 7 pointsize .5
set style line 3 linetype rgb "#666666"
set style line 4 linetype rgb "#FFFF00"
set style line 5 linetype rgb "#333333"
set label "°" right
unset mxtics
set tics textcolor rgb "#666666"
# X Axis
set xdata time
set xtics format "%a" nomirror
set autoscale xfix
set offsets 12*60*60,12*60*60,0,0
# Y Axis
set ytics format "%2f°" nomirror
set yrange [Ylow:Yhigh]
unset ytics
if (32 > Ylow) set label "32°" at graph 0.01,freezeLabel tc rgb "#FFFFFF" font ",8"
# Y2 Axis
set y2tics format "%2.0f%%" nomirror
set y2range [0:100]
plot dataFileForecast using 1:2 with lines,\
dataFileForecast using 1:2:3 with labels texcolor rgb "white",\
dataFileForecast using 1:4 with lines,\
dataFileForecast using 1:2:5 with labels textcolor rgb "white",\
freezeWarning with lines