On Wednesday, December 3, 2014 12:57:59 PM UTC-5, David Grier wrote:
> On Wednesday, December 3, 2014 12:41:41 PM UTC-5, Chris Torrence wrote:
>> On Wednesday, December 3, 2014 9:43:57 AM UTC-7, David Grier wrote:
>>> Dear Folks,
>>>
>>> I'd like to fill the plot area of a New Graphics plot with a solid color.
>>> So far, I haven't found a way to do this that does not blank out the plot
>>> itself. Here's a stripped-down example that is supposed to plot a diagonal
>>> line over a yellow background. The yellow polygon, however, covers up the
>>> diagonal line.
>>>
>>> win = window(dimensions = [512, 512])
>>> pos = [0.2, 0.2, 0.8, 0.8]
>>> ndx = [[0, 1], [2, 1], [2, 3], [0, 3], [0, 1]]
>>> verts = pos[ndx]
>>> poly = polygon(verts, /fill_background, fill_color = 'yellow', $
>>> fill_transparency = 0, target = win)
>>> pl = plot([0, 1], position = pos, current = win)
>>>
>>> I tried moving the polygon to the back with
>>> poly.order, /send_to_back
>>> and moving the plot to the front with
>>> pl.order, /bring_to_front
>>> Neither works.
>>>
>>>> print,!version
>>> { x86_64 darwin unix Mac OS X 8.4 Sep 27 2014 64 64}
>>>
>>> What's the right way to do what I want?
>>>
>>> All the best,
>>>
>>> David
>>
>> Hi David,
>>
>> Have you tried the BACKGROUND_COLOR property?
>>
>> p = PLOT(/TEST, BACKGROUND_COLOR='yellow')
>>
>> -Chris
>
> Dear Chris,
>
> Thanks for your suggestion.
> The straightforward solution works for simple cases, but not if I try to place
> a plot over an image. Here's an example:
>
> win = window(dimensions = [512, 512])
> im = image(randomu(seed, [512, 512]), position = [0, 0, 1, 1], current = win)
> pl = plot([0, 1], position = pos, current = win, background_color = 'yellow')
>
> The intention here is to superimpose a plot with a yellow background over a field
> of grayscale noise. The plot appears over the noise, but without the yellow
> background. That's why I started trying to use a polygon to fill in the frame.
>
> Is this a bug?
>
> TTFN,
>
> David
Oops: I forgot the position keyword:
pos = [0.2,0.2,0.8,0.8]
TTFN,
David
|