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

Home » Public Forums » archive » Re: cgHistoplot and logarithmic axes
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
Re: cgHistoplot and logarithmic axes [message #79861] Thu, 19 April 2012 06:24 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> Kwill writes:
>
>> I've been using David's excellent CG package for a while now, and have a question regarding cgHistoplot and logarithmic axes. I would like to make a histogram with logarithmic values on the y-axis (the histogram density). cgHistoplot will accept /YLOG as a keyword and plots the values, but the top axis is always misplaced; it appears in the bottom 25% of the plot. Any tips as to how this can be fixed?
>>
>> My version of cgHistoplot was last updated on 8 Nov 2011. Example code:
>>
>> IDL> x = randomu(seed,1000)
>> IDL> cgHistoplot, x, min_val=1, /ylog
>
> Alright, see what you think of this:
>
> http://www.idlcoyote.com/misc/cghistoplot.pro
>
> If it works, and doesn't bugger everything else up,
> I'll check it in.
>
> I've defined a new LOG keyword to represent the histogram
> count on a logarithmic scale.
>
> x = randomu(seed,1000)
> cgHistoplot, x, /fill, binsize=0.1, /log

Any reaction whatsoever to this updated program? Should
I check it in?

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.")
Re: cgHistoplot and logarithmic axes [message #79943 is a reply to message #79861] Wed, 11 April 2012 12:10 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kwill writes:

> I've been using David's excellent CG package for a while now, and have a question regarding cgHistoplot and logarithmic axes. I would like to make a histogram with logarithmic values on the y-axis (the histogram density). cgHistoplot will accept /YLOG as a keyword and plots the values, but the top axis is always misplaced; it appears in the bottom 25% of the plot. Any tips as to how this can be fixed?
>
> My version of cgHistoplot was last updated on 8 Nov 2011. Example code:
>
> IDL> x = randomu(seed,1000)
> IDL> cgHistoplot, x, min_val=1, /ylog

Alright, see what you think of this:

http://www.idlcoyote.com/misc/cghistoplot.pro

If it works, and doesn't bugger everything else up,
I'll check it in.

I've defined a new LOG keyword to represent the histogram
count on a logarithmic scale.

x = randomu(seed,1000)
cgHistoplot, x, /fill, binsize=0.1, /log

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.")
Re: cgHistoplot and logarithmic axes [message #79945 is a reply to message #79943] Wed, 11 April 2012 10:56 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kwill writes:

> I've been using David's excellent CG package for a while now, and have a question regarding cgHistoplot and logarithmic axes. I would like to make a histogram with logarithmic values on the y-axis (the histogram density). cgHistoplot will accept /YLOG as a keyword and plots the values, but the top axis is always misplaced; it appears in the bottom 25% of the plot. Any tips as to how this can be fixed?
>
> My version of cgHistoplot was last updated on 8 Nov 2011. Example code:
>
> IDL> x = randomu(seed,1000)
> IDL> cgHistoplot, x, min_val=1, /ylog

Have I mentioned how much I really, really love keyword
inheritance lately?

Sigh...

OK, I know what's wrong, but because of rotations, etc.
this is not a quick fix. I'm going to be out of the office
for a couple of days. I'll try to get it fixed before
I go, but I have lots of other things I am doing right now. :-(

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.")
Re: cgHistoplot and logarithmic axes [message #80211 is a reply to message #79861] Tue, 22 May 2012 10:00 Go to previous messageGo to next message
willettk is currently offline  willettk
Messages: 20
Registered: October 2006
Junior Member
On Thursday, April 19, 2012 8:24:05 AM UTC-5, David Fanning wrote:
> David Fanning writes:
>
>>
>> Kwill writes:
>>
>>> I've been using David's excellent CG package for a while now, and have a question regarding cgHistoplot and logarithmic axes. I would like to make a histogram with logarithmic values on the y-axis (the histogram density). cgHistoplot will accept /YLOG as a keyword and plots the values, but the top axis is always misplaced; it appears in the bottom 25% of the plot. Any tips as to how this can be fixed?
>>>
>>> My version of cgHistoplot was last updated on 8 Nov 2011. Example code:
>>>
>>> IDL> x = randomu(seed,1000)
>>> IDL> cgHistoplot, x, min_val=1, /ylog
>>
>> Alright, see what you think of this:
>>
>> http://www.idlcoyote.com/misc/cghistoplot.pro
>>
>> If it works, and doesn't bugger everything else up,
>> I'll check it in.
>>
>> I've defined a new LOG keyword to represent the histogram
>> count on a logarithmic scale.
>>
>> x = randomu(seed,1000)
>> cgHistoplot, x, /fill, binsize=0.1, /log
>
> Any reaction whatsoever to this updated program? Should
> I check it in?

My apologies for not checking this for so long, David. The fix on my computer looks excellent (and it appears that you checked it into the latest CG version). Thanks for doing this.

- kw

>
> 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.")
Re: cgHistoplot and logarithmic axes [message #92567 is a reply to message #79861] Fri, 15 January 2016 08:24 Go to previous messageGo to next message
chengyuxi34 is currently offline  chengyuxi34
Messages: 4
Registered: January 2016
Junior Member
Hi, Dear CG series ceator

I am still having problem using cghistoplot in log scale, the y-axis labels do not display correctly.
e.g.
IDL> cghistoplot,randomu(seed,1000),/log

The y-axis labels are just a bunch of zeros.
(My version was last updated on May, 2014)
Re: cgHistoplot and logarithmic axes [message #92568 is a reply to message #92567] Fri, 15 January 2016 08:41 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
chengyuxi34@gmail.com writes:

>
> Hi, Dear CG series ceator
>
> I am still having problem using cghistoplot in log scale, the y-axis labels do not display correctly.
> e.g.
> IDL> cghistoplot,randomu(seed,1000),/log
>
> The y-axis labels are just a bunch of zeros.
> (My version was last updated on May, 2014)

IDL> cghistoplot,randomu(seed,1000),/log, ytickformat='(F6.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: cgHistoplot and logarithmic axes [message #92569 is a reply to message #92568] Fri, 15 January 2016 08:45 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> IDL> cghistoplot,randomu(seed,1000),/log, ytickformat='(F6.2)'

Whoops! Got away from me. Too little practice. :-(

You can use any keywords available to the Plot command to format the
output in any way that seems appropriate to you. See "graphics
keywords" (or, more probably "keywords, graphics") in the IDL 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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: PyQT widgets?
Next Topic: IDL Help Annoyance

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

Current Time: Wed Oct 08 15:13:23 PDT 2025

Total time taken to generate the page: 0.00755 seconds