image function question [message #90208] |
Tue, 10 February 2015 17:53  |
Dae-Kyu Shin
Messages: 25 Registered: February 2015
|
Junior Member |
|
|
here is a example
data = DIST(500)
x = FINDGEN(500, start=1)
win = window()
win.refresh, /disable
i = image(data, x, x, /current, /axis)
win.save, 'test.png'
"test.png" file No image appears.!!(just axes)-> bug??
and question.
data = DIST(500)
x = FINDGEN(500, start=1)/5
c = contour(data, x, x, /ylog)
i = image(data, x, x, /ylog, /axis)
image function does not appear to ylog.(just yaxis value.....)
but contour function is OK.
Is that intended??
idl 8.4 and 8.3
|
|
|
Re: image function question [message #90211 is a reply to message #90208] |
Wed, 11 February 2015 02:33   |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
the first is easy.
take away:
win.refresh, /disable
Cheers, Helder
On Wednesday, February 11, 2015 at 2:53:08 AM UTC+1, Dae-Kyu Shin wrote:
> here is a example
>
> data = DIST(500)
> x = FINDGEN(500, start=1)
> win = window()
> win.refresh, /disable
> i = image(data, x, x, /current, /axis)
> win.save, 'test.png'
>
> "test.png" file No image appears.!!(just axes)-> bug??
>
>
>
>
> and question.
>
> data = DIST(500)
> x = FINDGEN(500, start=1)/5
>
> c = contour(data, x, x, /ylog)
> i = image(data, x, x, /ylog, /axis)
>
> image function does not appear to ylog.(just yaxis value.....)
> but contour function is OK.
> Is that intended??
>
>
>
> idl 8.4 and 8.3
|
|
|
|
Re: image function question [message #90213 is a reply to message #90212] |
Wed, 11 February 2015 08:13  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Wednesday, February 11, 2015 at 8:22:27 AM UTC-7, Fabien wrote:
> On 11.02.2015 02:53, Dae-Kyu Shin wrote:
>> image function does not appear to ylog.
>> but contour function is OK.
>> Is that intended??
>
> I think it is intended, or rather it is impossible for image() to know
> exactly what to do with your image. Stretching an image and changing its
> pixel resolution is a quite intrusive behavior, so that if you really
> want to stretch an image you should decide the "how" by yourself.
Hi all,
Fabien is correct - Image does not work with log axes - it would be weird (although possible) to stretch each pixel by a different "logarithmic" amount. So you either need to do the stretch manually... or perhaps better, you should take the log of your "y" axis values and do the contour plot without the log keyword.
And Helder's correct about the other one - if you do /disable, you had better do an /enable before trying to output.
Cheers,
Chris
|
|
|