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

Home » Public Forums » archive » Errorbar plot with max-min boundaries and bar plot with !P.Multi
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: Errorbar plot with max-min boundaries and bar plot with !P.Multi [message #86715 is a reply to message #86714] Fri, 29 November 2013 06:54 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Madhavan Bomidi writes:

> I was attempting to make 2 plots in 1 column using !P.Multi=[0,1,2]. My intention was to obtain: (1) top panel plot - Error estimation plot with mean, standard deviation as background and min-max as boundaries for a time-series data of a variable, (2) below panel plot - Bar plot showing the frequency of observations respectively at each time-step corresponding to the above plot. I started using the examples of colored line plots (for two row plotting), Error-estimate
plot (for top panel plot), and Bar plot without errorbars (for below panel plot).
>
> I made the following code, which is resulting in crazy errors and the plots are exchanging their positions (i.e., top panel <-> below panel). I got an error for bar plot as "CgAxis - Keyword array parameter XTICKNAME must have from 1 to 60 elements". I don't have any clue where I am actually going wrong, probably I have not understood properly the Coyote's library graphic routines. Can someone provide me assistance to achieve my desired plot?

When you are doing multiple plots with the *system variable* !P.MULTI
you can get into all kinds of problems when things don't go as they are
suppose to. In particular, if you have errors in your code, and you are
not using an error handler that restores !P.MULTI to its "normal" value,
then plots will jump around, etc. Remember, !P.MULTI is a *SYSTEM
VARIABLE*. It is *always* in effect in EVERY program you write!

I would take out the CLOSE, /ALL statement at the beginning of your code
(which marks you as a novice programmer, by the way) and replace it with
an error handler that looks like this:

Catch, theError
IF theError NE 0 THEN BEGIN
Catch, /Cancel
void = cgErrorMsg()
!P.Multi=0
RETURN
ENDIF

That should solve the plots "jumping around" problem. :-)

The "XTICKNAME must have from 1 to 60 elements" problem comes from a
limitation in IDL in which you can have no more that 59 labels on an
axis. cgBoxPlot tried to label each "box" it draws, so I presume you
have more than 60 of them.

If you have a LOT of boxes, it probably makes more sense to display them
differently than using a box plot. If you really need a box plot, you
could try creating your axes, then *overplotting* your boxes less than
60 at a time. I think I would prefer the first solution. Maybe using
just a line instead of a box to indicate the usual values.

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.")
[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
Read Message
Previous Topic: shapefile not in lat/lon
Next Topic: VERT_COLORS Problem

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

Current Time: Wed Oct 08 17:11:32 PDT 2025

Total time taken to generate the page: 0.00399 seconds