Key becomes invisible in pm3d gnuplot

后端 未结 1 1365
予麋鹿
予麋鹿 2021-01-21 08:55

I am using following code to draw a graph in gnuplot using pm3d map:

set pm3d map
set pm3d corners2color c1
spl \'patternD0pt02.dat\' title \"(a)\"
相关标签:
1条回答
  • 2021-01-21 09:17

    Indeed, the title is hidden behind the surface and there is no option set key front. This is a bug in 4.6. and is fixed in 5.0.

    You can workaround by placing a normal label, since the title of a pm3d plot doesn't plot a sample item. Putting a white rectangle behind the lable is a bit tricky:

    set label center at graph 0.95,0.95 front '(a)'
    set object rectangle front at graph 0.95,0.95 size char 5,2 fc rgb 'white' fillstyle solid noborder
    

    A full, working example is:

    set terminal pngcairo size 800,600
    set output 'foobar.png'
    
    set xrange [0:10]
    set yrange [0:10]
    set samples 20
    set isosamples 20
    
    set pm3d map
    
    set label center at graph 0.95,0.95 front '(a)'
    set object rectangle front at graph 0.95,0.95 size char 5,2 fc rgb 'white' fillstyle solid noborder
    splot '++' using 1:2:1
    

    The result with 4.6.4 is:

    enter image description here

    0 讨论(0)
提交回复
热议问题