Re: 8.* graphics [message #78966] |
Tue, 17 January 2012 11:56  |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
On Jan 17, 1:54 pm, alx <lecacheux.al...@wanadoo.fr> wrote:
> On 17 jan, 18:22, Russell <rryan....@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>> Okay, so I'm trying my hand at the new graphics features in IDL 8,
>> mostly because doing this in the classic direct graphics way is
>> incredible painful and (according to the help pages) the new stuff
>> should be able to knock this one out of the park. Famous last words,
>> I know. So here's the problem:
>
>> I'm trying to make a figure for an upcoming proposal where I want to
>> show a series of transmission curves (as a function of wavelength)
>> with the area under each curve shaded a different color. Many of
>> these curves have small overlaps with adjacent bands, and I'd like to
>> have the shading be the transparency (a la red+blue = purple). It
>> seems that plot.pro (the function not the procedure) is ready and
>> willing to do this, but I desperately need the x-axis to be displayed
>> as a log (so xlog=1b). However! the shading and transparency is
>> completely gone when I set xlog=1b! AAGGHH! Am I crazy, does anyone
>> know anything about this?
>
>> -Russell
>
>> PS, Yes, I'm aware that I can simply take the logarithm of the axis
>> and plot log(wavelength), but (1) I prefer the log-spaced tick marks
>> and (2) it *SHOULD* work! switching this bit shouldn't affect the
>> colors!
>
> What about this ?
>
> x = 10^(findgen(100)*0.03)
> b1 = exp(-(alog10(x)-1)^2/0.3)
> b2 = 0.5*exp(-(alog10(x)-2)^2/0.2)
>
> p1 = plot(x, b1, COLOR='red', /XTICKDIR, /YTICKDIR, /XLOG, THICK=3)
> p2 = plot(x, /OVERPLOT, b2, COLOR='blue', THICK=3)
> poly1 = polygon([x,x[0]], [b1,0], -0.01+fltarr(101), /DATA,
> LINESTYLE=6, $
> /FILL_BACKGROUND, FILL_COLOR=!COLOR.DEEP_PINK, FILL_TRANSPARENCY=50)
> poly2 = polygon([x,x[0]], [b2,0], -0.01+fltarr(101), /DATA,
> LINESTYLE=6, $
> /FILL_BACKGROUND, FILL_COLOR=!COLOR.DEEP_SKY_BLUE,
> FILL_TRANSPARENCY=50)
I like it. That should also fix one problem I had with the legend.
This is actually very close to my direct-graphics fix, so conceptually
I like it. Though, I still wish it just worked as advertised.
Thanks alx!
R
|
|
|