comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Questions about NG image with (log) axis
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Questions about NG image with (log) axis [message #85544 is a reply to message #85446] Thu, 15 August 2013 10:37 Go to previous messageGo to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Wednesday, August 7, 2013 6:10:17 AM UTC-6, Xin Tao wrote:
> Thanks Fab.
>
>
>
> I know David's Coyote library, it's very nice. I have used it a lot in the past. However, the NG in IDL 8 looks quite promising as the future of IDL plotting tools, and that's why I'm working on that. :-)
>
>
>
> Cheers,
>
>
>
> Xin Tao
>
>
>
> On Wednesday, August 7, 2013 7:59:56 PM UTC+8, Fabien wrote:
>
>> On 08/07/2013 11:22 AM, Xin Tao wrote:
>
>>
>
>>> the image x axis has a value from 10^20, 10^40, ..., 10^100. This is certainly wrong to me.
>
>>
>
>>
>
>>
>
>> Yes indeed, it looks like a bug. I am not a NG specialist though.
>
>>
>
>>
>
>>
>
>> I know it's not really constructive, but since David is not here I'll
>
>>
>
>> try to replace him as good as I can:
>
>>
>
>>
>
>>
>
>> x=10.0+dindgen(300)*(100-10.0)/(300-1)
>
>>
>
>> y=dindgen(300)
>
>>
>
>> data = dist(300)
>
>>
>
>> cgImage, data, x, y, /KEEP_ASPECT_RATIO, /AXES, MARGIN=1, $
>
>>
>
>> AXKEYWORDS={XLOG:1, XRANGE:[10,100]}, /WINDOW

Hi Xin Tao,

Well, I think both David's coyote library and IDL's NG are going to have problems with a log axis for an Image. When I try David's code (yes, I have it installed!) the axes "look" correct, but the image is just plotted as a normal image.

If the X axis were truly a "log" axis, then I would expect the pixels to be stretched out on the left side and get smaller as you moved to the right. For example, try the following:

x=10.0+dindgen(300)*(100-10.0)/(300-1)
y=dindgen(300)
data = dist(300)
c = contour(data, x, y, /xlog, /fill)

Notice how the contour plot is more stretched out on the left side. Is this what you want? If so, then you aren't going to be able to use an Image (either from NG or Coyote). You could use a filled contour plot, say with n_levels=50.

On the other hand, if you don't want a stretched out image, then you might want to take the log10 of your X data first, then do the i=image() and set the xtickvalues/xtickname to get the correct labels. In the meantime, I'll try to fix the Image function for IDL 8.3 so it at least gives the correct labels, even if it doesn't stretch out the pixels.

Cheers,
Chris
ExelisVIS
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to clear a NG window without erase method?
Next Topic: 'Reading' a file from binary data?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 08:05:31 PDT 2025

Total time taken to generate the page: 2.31866 seconds