Am 14.12.2012 00:33, schrieb sfeam:
>>> I suppose you could plot the boxes twice - the first time with solid fill
>>>
>>> of the desired color and the second time with a transparent pattern.
>>>
>>>
>>
>> The problem in this approach is the keys. Each plot generates one. Or only
>> the pattern or only the color appears in the key. Am I missing something?
>
>
> Use "notitle" to suppress one or the other.
> But yes, the key would only have the solid color or the pattern but not both.
>
>
Use multiplot to draw both plots in such a way that the second one
perfectly overlays the first one. Use boxes filled with a solid color
with the first plot and choose boxes filled with a pattern for the
second one. This should ensure that you get both: boxes with pattern and
a background color and a perfectly matching key.
The following script worked on my computer:
unset multiplot
reset
set terminal pngcairo size 800,550 font "Arial Narrow,18"
set output "Test01a.png"
set multiplot
set size 1.0,1.0
set origin 0.0,0.0
set samples 5
set key inside top center Left reverse samplen 2.0
XMIN = 0.0
XMAX = 1.0
XSTP = 0.1
set xrange [XMIN:XMAX]
set xtics XMIN,XSTP,XMAX
set xlabel "x"
YMIN = 0.0
YMAX = 1.0
YSTP = 0.2
set yrange [YMIN:YMAX]
set ytics YMIN,YSTP,YMAX
set ylabel "y"
set boxwidth 0.05 absolute
plot sin(x) title "sin(x)" with boxes fs solid 1.0 noborder lc rgb "green"
set size 1.0,1.0
set origin 0.0,0.0
set samples 5
set key inside top center Left reverse samplen 2.0
XMIN = 0.0
XMAX = 1.0
XSTP = 0.1
set xrange [XMIN:XMAX]
set xtics XMIN,XSTP,XMAX
set xlabel "x"
YMIN = 0.0
YMAX = 1.0
YSTP = 0.2
set yrange [YMIN:YMAX]
set ytics YMIN,YSTP,YMAX
set ylabel "y"
set boxwidth 0.05 absolute
plot sin(x) title "sin(x)" with boxes fs transparent pattern 1 border
rgb "black" lc rgb "black"
unset multiplot
unset output
I hope this helps.
Thomas