Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1547

Re: Boxes with both black pattern and background color

From Thomas Wagner <thomas.wagner.marl@freenet.de>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Boxes with both black pattern and background color
Date 2012-12-15 15:00 +0100
Organization albasani.net
Message-ID <kahvq9$91k$1@news.albasani.net> (permalink)
References <fc8b62cc-ef63-4377-a2be-fcb35d9ad7f8@googlegroups.com> <kadi6f$e6u$1@dont-email.me> <64dd475d-5a6d-40ee-a820-465af642ff03@googlegroups.com> <kadokp$kal$1@dont-email.me>

Show all headers | View raw


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

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Find similar


Thread

Boxes with both black pattern and background color Maxiwell Garcia <maxiwell@gmail.com> - 2012-12-13 13:01 -0800
  Re: Boxes with both black pattern and background color sfeam <sfeam@users.sourceforge.net> - 2012-12-13 13:43 -0800
    Re: Boxes with both black pattern and background color Maxiwell Garcia <maxiwell@gmail.com> - 2012-12-13 14:57 -0800
      Re: Boxes with both black pattern and background color sfeam <sfeam@users.sourceforge.net> - 2012-12-13 15:33 -0800
        Re: Boxes with both black pattern and background color Thomas Wagner <thomas.wagner.marl@freenet.de> - 2012-12-15 15:00 +0100

csiph-web