I'm using gnuplot to generate some graphs with black backgrounds. I'm trying to change all text (or better yet, all foreground elements) to a light color. At the moment I have to manually set a dozen or so different variables. I'm looking for a single command that will do this. So far nothing has worked.
At the moment my gnuplot file looks something like this:
#!/usr/bin/env gnuplot
set terminal svg size 1024,640 background rgb "#000000"
set output 'output.svg'
set key textcolor rgb "#ffffff"
set title "some title"
set xlabel "domain" textcolor rgb "#ffffff"
set ylabel "range" textcolor rgb "#ffffff"
set border linecolor rgb "#ffffff"
set style data lines
plot x**2 title "some function" with lines lc rgb "#ffffff"
Is there any way to consolidate all these "#fffffff"'s into setting a single command? Something like set foreground "#ffffff" or a global set fontcolor "#ffffff" would be nice if it did exist, but I haven't come across anything like this in the gnuplot manual.
That's probably not the answer you want to hear, but to my knowledge there is no option to invert all the labels, borders, etc. in one simple command from "light mode" to "dark mode". If there is, I would be happy to learn about it as well.
Well, you could shorten:
textcolortotc,linecolortolc,rgb "#ffffff"torgb 0xffffff,with linestow landtitletoti. You could shorten a few more commands, but then (to my opinion) readability will suffer. I don't know why you would needset style data lines. The example below is using the terminalwxt. Additionally, the example uses and x,y grid, where apparently you cannot set the color directly, but you have to set the color in a linestyle first.Script:
Result:
Well, you could define the textcolor and border color as a variable. If you want to change it you only have to change it at one location. Something like this: