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

Home » Public Forums » archive » Re: bar_plot barnames
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_plot barnames [message #59384 is a reply to message #59383] Wed, 19 March 2008 13:38 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
bar_names wants a string array - so it does it "on the fly". Try
obs_hours = sindgen(24)

Indy wrote:
> Hi All,
>
> I am having a problem with the BARNAMES keyword in BAR_PLOTS. My
> array, hours=indgen(24) to represent 0 to 23 hours in a day, is offset
> by to the right by just over 1 tick. So the bars line up with the
> ticks correctly, but the numbers along the bottom are shifted. The
> max is at 1400, but if you just read the numbers along the x-axis,
> below, the ticks, you'd interpret this as 1300.
>
> The small bit of plotting code is below...
>
> ; Hours Per Day
> obs_hours = indgen(24)
>
> ;make 2 plots on 1 row 0 remain on the page
> !P.MULTI=[0,2,1]
>
> ;turns off color table
> DEVICE, DECOMPOSED=0
>
> ;make axes black
> !P.COLOR=2
>
> LOADCT, 3, NCOLORS=24,BOTTOM=1
> colorIndices = indgen(24)+1
> window, xsize = 1000, ysize = 500
>
> ; ADJUST THE Y axis for Hourly FRP
> !Y.RANGE = [0,MAX(frp_hourly)*1.1]
>
> bar_plot, frp_hourly, COLORS=colorIndices, BARNAMES=obs_hours, $,
> BACKGROUND=255, BARWIDTH=0.75, BARSPACE=0.2, $
> TITLE = 'Hourly Total FRP' , $
> XTITLE = 'Local Hour (UTC+2)', $
> YTITLE = 'FRP(MW)'
[Message index]
 
Read Message
Read Message
Previous Topic: interpolation/gridding
Next Topic: "Lame" Dutch Bike

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

Current Time: Wed Dec 03 00:55:32 PST 2025

Total time taken to generate the page: 1.28614 seconds