title: how to change a gnuplot colorbox using custom colors
body: <p>I am using gnuplot to display the received signal strength of some
  small transmitters I'm testing. </p>
  
  <p>The data I'm gathering has the latitude, longitude and RSSI (received 
  signal strength indicator).</p>
  
  <p>Sample data:</p>
  
  <pre><code>-33.77432033,151.0664296,-49
  -33.7743059,151.0665004,-48
  -33.77427705,151.0666246,-48
  -33.7742775,151.0666962,-47
  </code></pre>
  
  <p>My function to color the values of the signal strength on the map is
  as follows:</p>
  
  <pre><code>rssicolor(a) = (-a &lt;= 65 ? (255*65536) + ((-a * (255/65))*256) + 0 \
   : (((255-(-a*(255/(120-65))))*65536)) + (255*256) + 0 )
  </code></pre>
  
  <p>For (strong signal) values from (-1 to -65) I plot from red (FF 00 00) to 
  yellow (FF FF 00). For (weaker) values from -65 to -120 I plot in colors 
  from yellow (FF FF 00) to green (00 FF 00). </p>
  
  <p>So far so good, all these colors are plotted correctly on the map using: </p>
  
  <pre><code>plot 'gps-data.txt' using 2:1:(rssicolor($3)) notitle with points lc rgb variable
  </code></pre>
  
  <p>In order to plot data on top of a background I use gnuplot in multiplot mode.</p>
  
  <p>A section of the final resulting image looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/lxykA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lxykA.jpg" alt="I know, it&#39;s not properly aligned"></a></p>
  
  <p>However, the colorbox on the right of the image shows a vastly different
  gradient of colors. It is determined by the function:</p>
  
  <pre><code>set cbrange [-40:-120]
  set cblabel "Signal Strength (dBm)" offset 0.0,0.0
  set zrange [0:1]
  unset xlabel 
  unset ylabel
  unset title
  unset xtics
  unset ytics
  set colorbox vertical user origin 0.87,0.1 size 0.02,0.5
  splot '++' u ($1):($2):(cos($1*$2)):($3) with pm3d
  unset multiplot
  </code></pre>
  
  <p>I am not sure how I should go about changing (or even interpreting) the command that is responsible for the color scheme in the colorbox.</p>
  
  <p>If I wanted a colorbox with gradient from Red-to-Yellow-to-Green do I 
  have to provide a separate data file with colors or can I somehow modify 
  the values in the above splot command to get that?</p>
  
  <p>I looked at some of the gnuplot help files but the splot command doesn't 
  show a lot of help. Also, studying the examples from the gnuplot website 
  shows many different colors being used but they all seem to be picking 
  them from a couple of standard color pallettes and I could not see one that goes from red-to-yellow-to-green.</p>
  
  <p>The simplest hack would just be to make my own colorbox in another 
  program and cut and paste it over this colorbox.</p>
  
  <p>Any suggestions?</p>