Gnuplot filledcurves with palette

后端 未结 6 978
有刺的猬
有刺的猬 2020-12-29 11:09

I have been trying to change the fillstyle for the filledcurves option in gnuplot so that the fill colour represents the difference between the two curves on a 2-dimensional

6条回答
  •  伪装坚强ぢ
    2020-12-29 11:17

    The trick is to draw the lines, then fill between them with filledcurves. Here's how to do it (based on the examples at gnuplot):

    set style line 2 lc rgb 'forest-green'
    set style line 3 lc rgb 'plum'
    set style fill pattern 5 lc 'yellow'
    set xrange [0:3000]
    set yrange [0:1]
    plot 'data.txt' u 1:2:3 w filledcurves notitle, \
         '' u 1:2 ls 2 with lines notitle, \
         '' u 1:3 ls 3 with lines notitle
    

    The output looks like this: enter image description here

    The data file contains these dummy values (that resemble your second graph):

    500     0.90    0.90
    1000    0.90    0.75
    1500    0.92    0.40
    2000    0.95    0.30
    2500    0.94    0.23
    

提交回复
热议问题