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

Home » Public Forums » archive » Re: BAR_PLOT restricted to 60 element ARRAY??
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 restricted to 60 element ARRAY?? [message #44663 is a reply to message #44661] Fri, 08 July 2005 04:11 Go to previous messageGo to previous message
Ben Panter is currently offline  Ben Panter
Messages: 102
Registered: July 2003
Senior Member
liko2@o2.pl wrote:
> Did you try this wit array containing several exacly the same values?It
> still creates one bar for this case...

We may be talking at cross purposes, but in my tests it didn't. I can
see I was a little too cryptic with n_elements. See the program below
for what I meant.

Save and compile the program at the end of this message, and with the
same x and y as before try this:

IDL> bp_plot_barchart, x,y, title='fred'
IDL> y[10:20]=0.6
IDL> bp_plot_barchart, x,y, title='fred'

which certainly draws lines between the 11 bars of the same height.

PROGRAM:

PRO bp_plot_barchart, x, y, _extra=e

;Make the initial plot

num_bar=n_elements(x)

plot, x, y, psym=10, _extra=e

;find midpoints for x ordinate of line

midpt=x[0:num_bar-2]+0.5*(x[1:num_bar-1]-x[0:num_bar-2])

;draw the lines

for i=0,num_bar-2 do plots, [midpt[i],midpt[i]], $
[!y.crange[0],max([y[i],y[i+1]])]

END


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ben Panter, Garching, Germany
email via www.benpanter.co.uk
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: shading in contour plots
Next Topic: Re: Windows IDL DLM with Cygwin

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

Current Time: Sat Oct 11 17:20:30 PDT 2025

Total time taken to generate the page: 0.00982 seconds