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

Home » Public Forums » archive » Bar coordinate shift with cgBarPlot
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: Bar coordinate shift with cgBarPlot [message #87752 is a reply to message #87749] Wed, 26 February 2014 02:09 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, February 26, 2014 8:30:21 AM UTC+1, Federico Tosi wrote:
> I have data separated for angle range: 0°-10°, 10°-20°, 20°-30°, 30°-40°, etc.. In the Y-coordinate is the number of observed data. When cgBarPlot is used, the vertical bars are centered on: 0°, 10°, 20°, 30°, while I would like them to be centered around: 5°, 15°, 25°, etc., so that the width of the bar is representative of the range of abscissa of my data.
>
>
>
> I'm afraid that, when the bars are cumulative (i.e., when multiple cgBarPlot are overplotted), drawing them one by one is unfeasible.
>
>
>
> Federico
>
>
>
>
>
>> The easiest way is probably just to draw the darn things yourself. But,
>
>>
>
>> I really don't understand what you are trying to do. :-)
>
>>
>
>> 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.")

I don't see a problem in doing this. If you read the documentation David has provided, then this is how I would do it: you will find two keywords you can use: barcoords and barnames (only if you want to show these).

How's this for you:
cgBarPlot, findgen(10), barcoords=findgen(10)*10.0, barnames=string(findgen(10)*10.0,format='(f0.1)')

Or if you want it centered in the middle, just change that to

cgBarPlot, findgen(10)+1.0, barcoords=findgen(10)*10.0+5.0, barnames=string(findgen(10)*10.0+5.0,format='(f0.1)')

What you have to figure out is what you give as input to cgBarPlot. If for the range 0-10 you give 0 or 10. Ideally you will want to use (low+high)/2.0. How you calculate that, depends on the input you have.

Cheers,
h
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to composite a mapcoord object using geographic coordinate(no projection)
Next Topic: Setting axes range in function graphics

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

Current Time: Fri Oct 10 12:42:22 PDT 2025

Total time taken to generate the page: 1.36044 seconds