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

Home » Public Forums » archive » cgImage abscissa values in axis feature
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
cgImage abscissa values in axis feature [message #88208] Fri, 28 March 2014 10:45 Go to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
Hi all (and mostly David),

I find myself very often in need to put an image into a plot with axis that show some x and y abscissa values, like in the way we use the contour command,
cgcontour, data, x,y
In cgImage, i can do this by setting the limits xr=[min(x),max(x)], yr=[min(x),max(x)] in a plot.
This works ok for uniform x,y but doesnot work for non uniform x,y.
Also, if you want repeat this some times, its more trouble than to simply put the x,y abscissa values directly.

Is there a way i can put x and y vectors as values for axis? And if not, would it be too much to ask for this feture in another version of cgImage?

Cheers,
Petros
Re: cgImage abscissa values in axis feature [message #88209 is a reply to message #88208] Fri, 28 March 2014 11:15 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> I find myself very often in need to put an image into a plot with axis that show some x and y abscissa values, like in the way we use the contour command,
> cgcontour, data, x,y
> In cgImage, i can do this by setting the limits xr=[min(x),max(x)], yr=[min(x),max(x)] in a plot.
> This works ok for uniform x,y but doesnot work for non uniform x,y.
> Also, if you want repeat this some times, its more trouble than to simply put the x,y abscissa values directly.
>
> Is there a way i can put x and y vectors as values for axis? And if not, would it be too much to ask for this feture in another version of cgImage?

Isn't the AXKEYWORDS keyword what you want? As far as I know you can
configure the axes anyway you like with this keyword.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88210 is a reply to message #88209] Fri, 28 March 2014 11:29 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Isn't the AXKEYWORDS keyword what you want? As far as I know you can
> configure the axes anyway you like with this keyword.

Or, if it is easier for you to use the cgContour or cgPlot commands,
that is easy, too:

cgImage, image, OPOSITION=opos, ...
cgContour, image, /nodata, /noerase, Position=opos, ...

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88211 is a reply to message #88210] Fri, 28 March 2014 12:13 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
Thanks for the quick reply David.

I was thinking more something like this:
Assume we have, x,y and data.
if we use
cgContour, data, x,y
we will get a plot with axis having the values of x,y

In cgImage, i was thinking like
cgImage, data, /axis, xabscissa=x, yabscissa=y

That would produce a similar result.
If somebody wants to plot many images with values on axis, this would be much faster and easier than
cgImage, data, /axis, xr=[min(x),max(x)], yr=[min(y),max(y)]

Cheers,

Petros




On Friday, March 28, 2014 6:29:22 PM UTC, David Fanning wrote:
> David Fanning writes:
>
>
>
>> Isn't the AXKEYWORDS keyword what you want? As far as I know you can
>
>> configure the axes anyway you like with this keyword.
>
>
>
> Or, if it is easier for you to use the cgContour or cgPlot commands,
>
> that is easy, too:
>
>
>
> cgImage, image, OPOSITION=opos, ...
>
> cgContour, image, /nodata, /noerase, Position=opos, ...
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88212 is a reply to message #88211] Fri, 28 March 2014 12:28 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

>
> Thanks for the quick reply David.
>
> I was thinking more something like this:
> Assume we have, x,y and data.
> if we use
> cgContour, data, x,y
> we will get a plot with axis having the values of x,y
>
> In cgImage, i was thinking like
> cgImage, data, /axis, xabscissa=x, yabscissa=y
>
> That would produce a similar result.
> If somebody wants to plot many images with values on axis, this would be much faster and easier than
> cgImage, data, /axis, xr=[min(x),max(x)], yr=[min(y),max(y)]

OK, now you have confused me. :-)

I thought you were looking for non-linear labeling of the axes. How does
this suggestion produce non-linear axis labeling?

Are you just looking to save a few keystrokes? In other words, are you
asking if I can let cgImage calculate the xrange from an X vector, and
so forth? I suppose I could. If you put some cash into the Coyote Store,
I suppose I might even want to. ;-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88214 is a reply to message #88212] Fri, 28 March 2014 12:57 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
Sorry for the confusion. The trick with the cgcontour solved my problem.

When i told you about
cgImage, data, /axis, xabscissa=x, yabscissa=y
meaning that the result would work for both uniform and non uniform x and y, without getting into more trouble, as the
cgcontour, data, x,y
does already

Of course
cgImage, data, /axis, xr=[min(x),max(x)], yr=[min(y),max(y)]
and
cgImage, data, /axis, xabscissa=x, yabscissa=y
would be equivalent only for uniform grid!

Now in terms of the keystrokes, the in uniform grid, i think
cgImage, data, /axis, xa=x, ya=y
is better than
cgImage, data, /axis, xr=[min(x),max(x)], yr=[min(y),max(y)]

And in the non uniform grid
cgImage, data, /axis, xa=x, ya=y
is better than
cgContour, data, /nodata, /noerase, OPosition=opos
cgImage, image, OPOSITION=opos, /noerase,/over
cgContour, data, /nodata, /noerase, Position=opos

Both are more simple and more intuitive. At least for me!

From your amazing work concerning usability and simplicity in idl graphics, I assume that a fan of simplicity such as yourself would like to get new ideas on how to improve the usability of his software!

Cheers,
Petros


On Friday, March 28, 2014 7:28:01 PM UTC, David Fanning wrote:
> Petros Syntelis writes:
>
>
>
>>
>
>> Thanks for the quick reply David.
>
>>
>
>> I was thinking more something like this:
>
>> Assume we have, x,y and data.
>
>> if we use
>
>> cgContour, data, x,y
>
>> we will get a plot with axis having the values of x,y
>
>>
>
>> In cgImage, i was thinking like
>
>> cgImage, data, /axis, xabscissa=x, yabscissa=y
>
>>
>
>> That would produce a similar result.
>
>> If somebody wants to plot many images with values on axis, this would be much faster and easier than
>
>> cgImage, data, /axis, xr=[min(x),max(x)], yr=[min(y),max(y)]
>
>
>
> OK, now you have confused me. :-)
>
>
>
> I thought you were looking for non-linear labeling of the axes. How does
>
> this suggestion produce non-linear axis labeling?
>
>
>
> Are you just looking to save a few keystrokes? In other words, are you
>
> asking if I can let cgImage calculate the xrange from an X vector, and
>
> so forth? I suppose I could. If you put some cash into the Coyote Store,
>
> I suppose I might even want to. ;-)
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88215 is a reply to message #88214] Fri, 28 March 2014 13:28 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> Sorry for the confusion. The trick with the cgcontour solved my problem.

Really!?

> When i told you about
> cgImage, data, /axis, xabscissa=x, yabscissa=y
> meaning that the result would work for both uniform and non uniform x and y, without getting into more trouble, as the
> cgcontour, data, x,y
> does already

Can you give me an example of x and Y vectors that "solve" this problem
for you with cgContour? Apparently I don't understand what you mean,
because I don't see how this can apply to cgImage in both the uniform
and non-uniform cases.

> Of course
> cgImage, data, /axis, xr=[min(x),max(x)], yr=[min(y),max(y)]
> and
> cgImage, data, /axis, xabscissa=x, yabscissa=y
> would be equivalent only for uniform grid!

I get this.

> Now in terms of the keystrokes, the in uniform grid, i think
> cgImage, data, /axis, xa=x, ya=y
> is better than
> cgImage, data, /axis, xr=[min(x),max(x)], yr=[min(y),max(y)]

You are probably right, but most of the images I work with are map
projected images from satellites and it is extraordinarily easy to get X
and Y ranges from the coordinate objects associated with these images.

> And in the non uniform grid
> cgImage, data, /axis, xa=x, ya=y
> is better than
> cgContour, data, /nodata, /noerase, OPosition=opos
> cgImage, image, OPOSITION=opos, /noerase,/over
> cgContour, data, /nodata, /noerase, Position=opos

I really fail to see how this works with a non-uniform grid. You don't
want pixel values to be stretched, do you?

> Both are more simple and more intuitive. At least for me!

Yes, I can believe that, although I would be hard pressed to come up
with vectors for the images I work with.

> From your amazing work concerning usability and simplicity in idl graphics, I assume that a fan of simplicity such as yourself would like to get new ideas on how to improve the usability of his software!

Let me tell you a story.

There is a trail near my house on a creek. I've been walking it
regularly for the past month or so, and I've noticed it is totally
trashed out. So, when I want a break from work I go down there with a
trash bag and pick up the trash. In two weeks, I've carried about 50
pounds of trash home from a maybe a half mile stretch of trail.

This is a well used trail, so maybe 150 people have seen me picking up
trash. Three people have thanked me. The rest give me a wide berth,
assuming, probably, that I am doing community service for the Sheriff.

Yesterday, when I was walking on the trail (pretty clean now!) I noticed
something new. People have noticed that *someone* is cleaning up the
trail, so they are leaving their little bags of dog shit near a trail
marker so I can pick those up, too.

I tell you this story because there are days, sometimes weeks, when I
feel incredibly taken advantage of. I've lost my spiritual mojo, you
could say. This is one of those weeks.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88217 is a reply to message #88208] Fri, 28 March 2014 14:09 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
Well i caused much confusion and this wasn't my intent.
I don't need strch of pixel or things like that. Forget about the non-uniform grid.
I was talking about non uniform vectors in the sense of
x=findgen(10)
cgcontour, data, x^2, alog10(x)
Nothing more than that. Sorry for the trouble i caused you, because clearly i couldn't get you to understand what i was saying, as i was saying it wrong!

I use images from solar observatories, where every data set comes with a solar_x and solar_y vector.
In the last years I've made my own wrapper programs of tv about plotting imaging, or use astrolib routines, but the more i use coyote library the more i want to use it fully, without making wrapper for it. This is why i discussed about intuitive and simple things.

Now about the previous discussion with the cgImage, in general, i think that an axis goes with a vector that defines it, so this is what i was referring as intuitive.

Besides that cgImage discussion, by no means I did not mean to offend you or to make you upset by this conversation.
After all, if you weren't involved with idl graphics, everybody dealing with IDL would have to curse daily 20 times more the people who designed idl graphics in the first place, and feel 20 times more miserable trying to do the simplest thing.
I personally cannot work without your work, which i admire greatly. And that is why the more i use it, the more people i try to persuade to use it.
That is the reason i post about bugs i find etc. I like it see it becoming even better! It feels like posting in opensource project forums!

I dont know if i sounded ironic telling you "From your amazing work concerning usability and simplicity in idl graphics, I assume that a fan of simplicity such as yourself would like to get new ideas on how to improve the usability of his software!"

I honestly believe every word of it, and i think the above as a compliment.

Regards,
Petros


On Friday, March 28, 2014 5:45:55 PM UTC, Petros Syntelis wrote:
> Hi all (and mostly David),
>
>
>
> I find myself very often in need to put an image into a plot with axis that show some x and y abscissa values, like in the way we use the contour command,
>
> cgcontour, data, x,y
>
> In cgImage, i can do this by setting the limits xr=[min(x),max(x)], yr=[min(x),max(x)] in a plot.
>
> This works ok for uniform x,y but doesnot work for non uniform x,y.
>
> Also, if you want repeat this some times, its more trouble than to simply put the x,y abscissa values directly.
>
>
>
> Is there a way i can put x and y vectors as values for axis? And if not, would it be too much to ask for this feture in another version of cgImage?
>
>
>
> Cheers,
>
> Petros
Re: cgImage abscissa values in axis feature [message #88218 is a reply to message #88217] Fri, 28 March 2014 15:22 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> Well i caused much confusion and this wasn't my intent.
> I don't need strch of pixel or things like that. Forget about the non-uniform grid.
> I was talking about non uniform vectors in the sense of
> x=findgen(10)
> cgcontour, data, x^2, alog10(x)
> Nothing more than that. Sorry for the trouble i caused you, because clearly i couldn't get you to understand what i was saying, as i was saying it wrong!

Thanks, Petros. After a walk (on a clean trail!) and your note, I feel
restored. I'll see what I can do about cgImage. ;-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88236 is a reply to message #88208] Tue, 01 April 2014 07:40 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> Is there a way i can put x and y vectors as values for axis? And if not, would it be too much to ask for this feture in another version of cgImage?

Done. You can find the program here:

http://www.idlcoyote.com/programs/cgimage.pro

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88272 is a reply to message #88236] Mon, 07 April 2014 06:06 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
David thank you very very much!

On Tuesday, April 1, 2014 3:40:24 PM UTC+1, David Fanning wrote:
> Petros Syntelis writes:
>
>
>
>> Is there a way i can put x and y vectors as values for axis? And if not, would it be too much to ask for this feture in another version of cgImage?
>
>
>
> Done. You can find the program here:
>
>
>
> http://www.idlcoyote.com/programs/cgimage.pro
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88273 is a reply to message #88272] Mon, 07 April 2014 06:16 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
Hey David, I think there is something funky going on with the axis color. I did

loadct,0
im=cgdemodata(4)
x=findgen(256)
cgimage, im,/axis

and

cgimage, im,/axis, xv=x,yv=v

and in both cases the color of the axis is either white or something different.

Cheers,
Petros


On Monday, April 7, 2014 2:06:39 PM UTC+1, Petros Syntelis wrote:
> David thank you very very much!
>
>
>
> On Tuesday, April 1, 2014 3:40:24 PM UTC+1, David Fanning wrote:
>
>> Petros Syntelis writes:
>
>>
>
>>
>
>>
>
>>> Is there a way i can put x and y vectors as values for axis? And if not, would it be too much to ask for this feture in another version of cgImage?
>
>>
>
>>
>
>>
>
>> Done. You can find the program here:
>
>>
>
>>
>
>>
>
>> http://www.idlcoyote.com/programs/cgimage.pro
>
>>
>
>>
>
>>
>
>> Cheers,
>
>>
>
>>
>
>>
>
>> David
>
>>
>
>> --
>
>>
>
>> David Fanning, Ph.D.
>
>>
>
>> Fanning Software Consulting, Inc.
>
>>
>
>> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
>>
>
>> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88274 is a reply to message #88273] Mon, 07 April 2014 06:55 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> Hey David, I think there is something funky going on with the axis color. I did
>
> loadct,0
> im=cgdemodata(4)
> x=findgen(256)
> cgimage, im,/axis
>
> and
>
> cgimage, im,/axis, xv=x,yv=v
>
> and in both cases the color of the axis is either white or something different.

Yeah, don't know. I don't see anything funky. Did you update your Coyote
Library or just cgImage? What kind of computer?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88275 is a reply to message #88274] Mon, 07 April 2014 09:06 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
I've downloaded the whole library and replaced the old one on my computer. My computer runs Mac OS X 10.8.5. I've restarted idl and the whole computer also!

The funny thing is that almost every time i run the cgimage command i get a different axis color.
Also, If i run create a cgdispaly window it resolves partly the problem
So, this code:
!p.multi=[0,5,5]
cgdisplay, 600,400
for i=0,24 do cgimage, im,xv=x,yv=x,/axis
!p.multi=0

creates a series of plots where the first 4 plots have black axis and the rest have white axis.

This code, on the other hand,
!p.multi=[0,5,5]
for i=0,24 do cgimage, im,xv=x,yv=x,/axis
!p.multi=0

creates axis with all sorts of different colors. And the colors change randomly every time i run the for loop!
Also, when i tried to take a snapshot
snap=cgSnapshot(file='snaphot.png')
The resulting png file have colored vertical bars, like an old television that can't get signal..

What have i done??


On Monday, April 7, 2014 2:55:53 PM UTC+1, David Fanning wrote:
> Petros Syntelis writes:
>
>
>
>> Hey David, I think there is something funky going on with the axis color. I did
>
>>
>
>> loadct,0
>
>> im=cgdemodata(4)
>
>> x=findgen(256)
>
>> cgimage, im,/axis
>
>>
>
>> and
>
>>
>
>> cgimage, im,/axis, xv=x,yv=v
>
>>
>
>> and in both cases the color of the axis is either white or something different.
>
>
>
> Yeah, don't know. I don't see anything funky. Did you update your Coyote
>
> Library or just cgImage? What kind of computer?
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88276 is a reply to message #88275] Mon, 07 April 2014 09:10 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> I've downloaded the whole library and replaced the old one on my computer. My computer runs Mac OS X 10.8.5. I've restarted idl and the whole computer also!
>
> The funny thing is that almost every time i run the cgimage command i get a different axis color.
> Also, If i run create a cgdispaly window it resolves partly the problem
> So, this code:
> !p.multi=[0,5,5]
> cgdisplay, 600,400
> for i=0,24 do cgimage, im,xv=x,yv=x,/axis
> !p.multi=0
>
> creates a series of plots where the first 4 plots have black axis and the rest have white axis.
>
> This code, on the other hand,
> !p.multi=[0,5,5]
> for i=0,24 do cgimage, im,xv=x,yv=x,/axis
> !p.multi=0
>
> creates axis with all sorts of different colors. And the colors change randomly every time i run the for loop!
> Also, when i tried to take a snapshot
> snap=cgSnapshot(file='snaphot.png')
> The resulting png file have colored vertical bars, like an old television that can't get signal..
>
> What have i done??

Oh, my gosh! Bought the wrong computer, it sounds like. ;-)

Can you start IDL up fresh and give me the results of this command:

IDL> Help, /Device

Also, what version of IDL is this?

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88277 is a reply to message #88208] Mon, 07 April 2014 09:15 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
How much i would like the good old "hitting the computer" could move a cable or something and fix the problem :p

This is the result of Help, /Device

IDL> help, /Device
Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
Current graphics device: X
Server: X11.0, The X.Org Foundation, Release 11404000
Display Depth, Size: 24 bits, (1280,778)
Visual Class: TrueColor (4)
Bits Per RGB: 8 (8/8/8)
Physical Color Map Entries (Emulated / Actual): 256 / 256
Colormap: Private, 16777216 colors. Translation table: Enabled
Graphics pixels: Combined, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Req from Server.

and the idl version in 7.1.1


On Friday, March 28, 2014 5:45:55 PM UTC, Petros Syntelis wrote:
> Hi all (and mostly David),
>
>
>
> I find myself very often in need to put an image into a plot with axis that show some x and y abscissa values, like in the way we use the contour command,
>
> cgcontour, data, x,y
>
> In cgImage, i can do this by setting the limits xr=[min(x),max(x)], yr=[min(x),max(x)] in a plot.
>
> This works ok for uniform x,y but doesnot work for non uniform x,y.
>
> Also, if you want repeat this some times, its more trouble than to simply put the x,y abscissa values directly.
>
>
>
> Is there a way i can put x and y vectors as values for axis? And if not, would it be too much to ask for this feture in another version of cgImage?
>
>
>
> Cheers,
>
> Petros
Re: cgImage abscissa values in axis feature [message #88278 is a reply to message #88277] Mon, 07 April 2014 09:29 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

>
> How much i would like the good old "hitting the computer" could move a cable or something and fix the problem :p
>
> This is the result of Help, /Device
>
> IDL> help, /Device
> Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
> Current graphics device: X
> Server: X11.0, The X.Org Foundation, Release 11404000
> Display Depth, Size: 24 bits, (1280,778)
> Visual Class: TrueColor (4)
> Bits Per RGB: 8 (8/8/8)
> Physical Color Map Entries (Emulated / Actual): 256 / 256
> Colormap: Private, 16777216 colors. Translation table: Enabled
> Graphics pixels: Combined, Dither Method: Ordered
> Write Mask: 16777215 (decimal) ffffff (hex)
> Graphics Function: 3 (copy)
> Current Font: <default>, Current TrueType Font: <default>
> Default Backing Store: Req from Server.
>
> and the idl version in 7.1.1

Yeah, I'd try giving it a smack! :-)

Then, try this in a fresh IDL session:

IDL> DEVICE, /BYPASS_TRANSLATION

Does that make any difference?

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88279 is a reply to message #88278] Mon, 07 April 2014 09:36 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
This didn't solve the problem.. I think though the different colors on the axis became more vivid now!!!

On Monday, April 7, 2014 5:29:24 PM UTC+1, David Fanning wrote:
> Petros Syntelis writes:
>
>
>
>>
>
>> How much i would like the good old "hitting the computer" could move a cable or something and fix the problem :p
>
>>
>
>> This is the result of Help, /Device
>
>>
>
>> IDL> help, /Device
>
>> Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
>
>> Current graphics device: X
>
>> Server: X11.0, The X.Org Foundation, Release 11404000
>
>> Display Depth, Size: 24 bits, (1280,778)
>
>> Visual Class: TrueColor (4)
>
>> Bits Per RGB: 8 (8/8/8)
>
>> Physical Color Map Entries (Emulated / Actual): 256 / 256
>
>> Colormap: Private, 16777216 colors. Translation table: Enabled
>
>> Graphics pixels: Combined, Dither Method: Ordered
>
>> Write Mask: 16777215 (decimal) ffffff (hex)
>
>> Graphics Function: 3 (copy)
>
>> Current Font: <default>, Current TrueType Font: <default>
>
>> Default Backing Store: Req from Server.
>
>>
>
>> and the idl version in 7.1.1
>
>
>
> Yeah, I'd try giving it a smack! :-)
>
>
>
> Then, try this in a fresh IDL session:
>
>
>
> IDL> DEVICE, /BYPASS_TRANSLATION
>
>
>
> Does that make any difference?
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88280 is a reply to message #88279] Mon, 07 April 2014 09:40 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> This didn't solve the problem.. I think though the different colors on the axis became more vivid now!!!

Well, that's always good. :-)

I really don't know. What kind of X window system are you using? I don't
think this has anything to do with IDL, to be honest. I think it is an X
window setup thing or bug or something. I'm not a Mac guy, so we
probably need someone with more expertise to help.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88281 is a reply to message #88280] Mon, 07 April 2014 09:47 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
Oooh Ok then. I'll search about this online.
Thanks for all the help!

On Monday, April 7, 2014 5:40:08 PM UTC+1, David Fanning wrote:
> Petros Syntelis writes:
>
>
>
>> This didn't solve the problem.. I think though the different colors on the axis became more vivid now!!!
>
>
>
> Well, that's always good. :-)
>
>
>
> I really don't know. What kind of X window system are you using? I don't
>
> think this has anything to do with IDL, to be honest. I think it is an X
>
> window setup thing or bug or something. I'm not a Mac guy, so we
>
> probably need someone with more expertise to help.
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88282 is a reply to message #88281] Mon, 07 April 2014 10:11 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> Oooh Ok then. I'll search about this online.

I suspect the problem, whatever it is, has to do with reading pixel
values from the display. We could confirm that by doing something like
this and seeing if the axes are the correct color:

!p.multi=[0,5,5]
for i=0,24 do cgimage, im,xv=x,yv=x,/axis, color='dodger blue'
!p.multi=0

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88283 is a reply to message #88282] Mon, 07 April 2014 10:27 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I suspect the problem, whatever it is, has to do with reading pixel
> values from the display. We could confirm that by doing something like
> this and seeing if the axes are the correct color:
>
> !p.multi=[0,5,5]
> for i=0,24 do cgimage, im,xv=x,yv=x,/axis, color='dodger blue'
> !p.multi=0

Another idea just occurred to me. Type this command, then open a window
and see what happens:

IDL> Device, Retain=2
IDL> cgDisplay
IDL> cgImage, cgDemodata(7), /Axes

Maybe it is a backing store problem.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88284 is a reply to message #88283] Mon, 07 April 2014 11:42 Go to previous messageGo to next message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
This solution
for i=0,24 do cgimage, im,xv=x,yv=x,/axis, color='dodger blue'
works like a charm, regardless of Device settings etc.

About the retain:
If i use:
Device, Retain=0
!p.multi=[0,5,5]
for i=0,24 do cgImage, im, /Axes & !p.multi=0
I get colors.

If i use
Device, Retain=2
!p.multi=[0,5,5]
for i=0,24 do cgImage, im, /Axes & !p.multi=0
I get colors

if i use
Device, Retain=2
cgDisplay
!p.multi=[0,5,5]
for i=0,24 do cgImage, im, /Axes & !p.multi=0
I don't get colors, but i have the other "bug" the first 4 plots have black axes and the others have white..
i get the same result if retain is set to 0, so i think that cgDisplay does some trick and solves the problem at some extent.


On Monday, April 7, 2014 6:27:44 PM UTC+1, David Fanning wrote:
> David Fanning writes:
>
>
>
>> I suspect the problem, whatever it is, has to do with reading pixel
>
>> values from the display. We could confirm that by doing something like
>
>> this and seeing if the axes are the correct color:
>
>>
>
>> !p.multi=[0,5,5]
>
>> for i=0,24 do cgimage, im,xv=x,yv=x,/axis, color='dodger blue'
>
>> !p.multi=0
>
>
>
> Another idea just occurred to me. Type this command, then open a window
>
> and see what happens:
>
>
>
> IDL> Device, Retain=2
>
> IDL> cgDisplay
>
> IDL> cgImage, cgDemodata(7), /Axes
>
>
>
> Maybe it is a backing store problem.
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88285 is a reply to message #88284] Mon, 07 April 2014 12:13 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Petros Syntelis writes:

> This solution
> for i=0,24 do cgimage, im,xv=x,yv=x,/axis, color='dodger blue'
> works like a charm, regardless of Device settings etc.
>
> About the retain:
> If i use:
> Device, Retain=0
> !p.multi=[0,5,5]
> for i=0,24 do cgImage, im, /Axes & !p.multi=0
> I get colors.
>
> If i use
> Device, Retain=2
> !p.multi=[0,5,5]
> for i=0,24 do cgImage, im, /Axes & !p.multi=0
> I get colors
>
> if i use
> Device, Retain=2
> cgDisplay
> !p.multi=[0,5,5]
> for i=0,24 do cgImage, im, /Axes & !p.multi=0
> I don't get colors, but i have the other "bug" the first 4 plots have black axes and the others have white..
> i get the same result if retain is set to 0, so i think that cgDisplay does some trick and solves the problem at some extent.

I think your X window manager is having trouble reading pixel
information from a graphics window. This is the the only thing that
makes any sense to me. Maybe its reading 4 bit per channel, or 16, or
who knows what, but something is wrong there.

I don't think cgDisplay does any "tricks". It opens an IDL graphics
window and erases it with a white color. Maybe the bug, whatever it is,
likes white windows more than black windows. I feel the same way. :-)

Oh!! You know what is happening here?

The axes, by default, set their color to "opposite". They read the pixel
in the upper-right corner of the window and then set the axis color to
the "opposite" of whatever color is displayed in that single pixel. I'll
bet one of your images is overwriting that pixel with a dark color,
which makes all subsequent image plots be drawn in a very light color.

Is this what is going on? Maybe you should set the MultiMargin keyword
cgImage to see if this works correctly if you don't completely fill up
the !P.Multi region.

for i=0,24 do cgImage, im, /Axes, multimargin=2

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgImage abscissa values in axis feature [message #88291 is a reply to message #88208] Tue, 08 April 2014 02:23 Go to previous message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
This is close i think,

In case i use
cgDisplay
for i=0,24 do cgImage,im,/Axes,multimargin=2

problem is solved.

If i use just
for i=0,24 do cgImage,im,/Axes,multimargin=2
the rainbow colored axes still exist.

So it must have to do something with the background color and the way axis pick colors.

On Friday, March 28, 2014 5:45:55 PM UTC, Petros Syntelis wrote:
> Hi all (and mostly David),
>
>
>
> I find myself very often in need to put an image into a plot with axis that show some x and y abscissa values, like in the way we use the contour command,
>
> cgcontour, data, x,y
>
> In cgImage, i can do this by setting the limits xr=[min(x),max(x)], yr=[min(x),max(x)] in a plot.
>
> This works ok for uniform x,y but doesnot work for non uniform x,y.
>
> Also, if you want repeat this some times, its more trouble than to simply put the x,y abscissa values directly.
>
>
>
> Is there a way i can put x and y vectors as values for axis? And if not, would it be too much to ask for this feture in another version of cgImage?
>
>
>
> Cheers,
>
> Petros
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ENVI/IDL vegetation identification
Next Topic: installation without a CD

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

Current Time: Wed Oct 08 09:15:32 PDT 2025

Total time taken to generate the page: 0.01610 seconds