comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: cgHistoplot issue

Re: cgHistoplot issue
type: item
description: JBT writes: > Just report one bug of cgHistoplot. > > When setting a xrange to cgHistoplot, it automatically changes the yrange too, which is not supposed to happen. You can repeat the problem with the following code. > > data = randomu(5L, 200)*20. > cgHistoplot, data, BINSIZE=1.0 > cgHistoplot, data, BINSIZE=1.0, xr = [0, 15] > > The first two lines were actually copied from idlcoyote.com. And you can see the problem after running the third line. Humm. This turns out to be a property of the PLOT command that, frankly, I don't understand right at the moment. Consider this: IDL> x = [-0.96062616, 21.975719] IDL> y = [0,14.7] IDL> plot, x, y But, now set the XRANGE: IDL> plot, x, y, xrange=[0,15] What do you make of that!? :-( Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2011-05-18T22:28:11-00:00

Re: cgHistoplot issue
type: item
description: Yeah, you are right, David. Then I guess this is a bug of plot rather than of cghistoplot. Anyway, it's not terribly a big deal, just annoying. JBT
creator: Jianbao
date: 2011-05-18T22:48:27-00:00

Re: cgHistoplot issue
type: item
description: David Fanning writes: > > JBT writes: > >> Just report one bug of cgHistoplot. >> >> When setting a xrange to cgHistoplot, it automatically changes the yrange too, which is not supposed to happen. You can repeat the problem with the following code. >> >> data = randomu(5L, 200)*20. >> cgHistoplot, data, BINSIZE=1.0 >> cgHistoplot, data, BINSIZE=1.0, xr = [0, 15] >> >> The first two lines were actually copied from idlcoyote.com. And you can see the problem after running the third line. > > Humm. This turns out to be a property of the PLOT > command that, frankly, I don't understand right > at the moment. Consider this: > > IDL> x = [-0.96062616, 21.975719] > IDL> y = [0,14.7] > IDL> plot, x, y > > But, now set the XRANGE: > > IDL> plot, x, y, xrange=[0,15] > > What do you make of that!? :-( If I try to zoom the plot: IDL> fsc_zplot, x, y, xrange=[0,15] It starts out broken, but as soon as I touch the plot to zoom it, it does the right thing! Weird. I don't know what to tell you. This looks like a bug with the plot command to me. This is one time when, I admit, iPlot produces a better plot than the Plot command! :-) IDL> iPlot, x, y, xrange=[0,15] Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2011-05-18T22:50:57-00:00

Re: cgHistoplot issue
type: item
description: On 05/19/2011 12:48 AM, JBT wrote: > Yeah, you are right, David. Then I guess this is a bug of plot rather than of cghistoplot. Anyway, it's not terribly a big deal, just annoying. > > JBT I don't know if its a bug. Plot has always done what it *thinks* to be the best for the XY ranges. Sometimes it makes sense, sometimes not...
creator: Fabzou
date: 2011-05-19T02:25:22-00:00

Re: cgHistoplot issue
type: item
description: Fabzou writes: > I don't know if its a bug. Plot has always done what it *thinks* to be > the best for the XY ranges. Sometimes it makes sense, sometimes not... Well, it's true that it has a mind of its own about aesthetic axes, but in 25 years I've never seen it do something this perverse. I'm sure it's a bug, but I have made no headway figuring out a theory for how the bug came to exist. :-( Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2011-05-19T02:57:09-00:00

Re: cgHistoplot issue
type: item
description: I've actually run into this before. The algorithm that plot uses to decide on the y range is pretty straightforward - it uses the values of the data points within the x range that it is plotting. In David's example, there are *no* data points in the x range, so it defaults to [0,1]. Without looking into the internals of cghistoplot, I can't say for sure, but I would guess that a similar situation is occurring. -Jeremy.
creator: Jeremy Bailin
date: 2011-05-19T14:28:22-00:00

Re: cgHistoplot issue
type: item
description: Jeremy Bailin writes: > I've actually run into this before. The algorithm that plot uses to decide on the y range is pretty straightforward - it uses the values of the data points within the x range that it is plotting. In David's example, there are *no* data points in the x range, so it defaults to [0,1]. Without looking into the internals of cghistoplot, I can't say for sure, but I would guess that a similar situation is occurring. Ah, of course! Thanks! Maybe I know how to fix this then. :-) Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2011-05-19T14:31:38-00:00

Re: cgHistoplot issue
type: item
description: David Fanning writes: > Ah, of course! Thanks! Maybe I know > how to fix this then. :-) OK, I fixed cgHistogram. You can find it here: http://www.idlcoyote.com/programs/cghistogram.pro In cgHistogram I was calculating the min and max ranges for the plot in the variables xrange and yrange. I was creating the plot scaffolding for the histogram plot, by using the PLOT command like this: Plot, xrange, yrange, ... The fix was simply to create the plot like this: Plot, [0,0], xrange=xrange, yrange=yrange, ... Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2011-05-19T14:47:19-00:00