1
votes

I am trying to plot a solar spectrum. I am having difficulty with Gnuplot mapping the colors that I specify to the correct values. Here is my script.

set view map
set pm3d 
set palette defined (380 "purple", 475 "blue", 510 "green", 570 "yellow", 590 "orange", 650 "red", 675 "dark-red", 700 "black")
splot [400:800][0:1] x

enter image description here

As you can see at x=510, there plot is not green. Likewise it is not yellow at 570 as I specified. How do I fix this so the colors on the plot match what I specified?

1

1 Answers

0
votes

I need to specify cbrange to match the plot ranges, e.g.

set view map
set pm3d 
set palette defined (400 "purple", 475 "blue", 510 "green", 570 "yellow", 590 "orange", 650 "red", 675 "dark-red", 700 "black")
splot [400:700][0:1] x
set cbrange [400:700]

so that the colors are scaled correctly.