View Full Version : a one-line stacked bar chart?

04-08-2009, 12:16 PM
I thought this would be simple to do, but I am running into trouble.

I know how to generate a horizontal stacked bar chart. E.g., this one shows 3 groups along the y-axis:

group = [[100,200,100],[200,150,100],[400,200,100]]
bar, group, /horizontal, /stacked

If I want to only show one of the y-axis groups, how do I do that? When I try, it does not do the horizontal stacking:

group = [[100,200,100],[200,150,100],[400,200,100]]
bar, group(*,0), /horizontal, /stacked

04-08-2009, 05:43 PM
The documentation is pretty clear that the stacked keyword only works for 2D input arrays:

"Stacked?If the input array is a 2D array and the Stacked keyword is set, then the first dimension of the input array is construed as a stack and the second dimension as a bar value. See the Examples section for examples of stacked and grouped bar charts."

I do not believe you can use this function to plot the degenerate case...

04-09-2009, 08:16 AM
That's a pretty weak answer, since I can easily pass the function a 2D array of dimensions M x 1. BAR still does not plot it correctly.

group = [[100,200,100],[200,150,100],[400,200,100]]
group_new = reform(group(*,0), [3, 1])
info, group
;GROUP INT = Array(3, 3)
info, group_new
;GORUP_NEW INT = Array(3, 1)
bar, group_new, /horizontal, /stacked
; doesn't work!

Would it trouble you too much to find a way to extend the code instead of explaining why it doesn't work?

04-09-2009, 09:57 AM
I looked at the source code for bar.pro and found that the problem arises because wave trims degenerate dimensions when you make variable copies (see line 170):

info, x
; X INT = Array(3, 1)
yy = x
; YY INT = Array(3)

The solution to this, I think, is to reform the yy array back to the original dimensions of x:

yy = x
szy = SIZE(x)
xx = x
yy = y
szy = SIZE(y)

IF szy(0) EQ 2 THEN yy = REFORM(yy, szy(1:2))
IF szy(0) EQ 3 THEN yy = REFORM(yy, szy(1:3))

This works. Can this modification be made available in the next release of PV-WAVE?

04-09-2009, 10:36 AM
We're happy to file an Enhancement Request based on you findings. You can contact Support (support@vni.com) to get the tracking number for this Change Request (CR).

Don B.

04-16-2009, 02:24 PM

Can you explain how the enhancement request process works? Which requests get priority, and how do you decide which changes get added to a patch release?

I wish I had more confidence in the process than I do. I filed a Change Request in 2006 that was marked "High Priority" and am still waiting three years later for someone to work on it. It seems that if the problem is small, it may be fixed, but if it requires a serious amount of work (or it involves significant alterations to the underlying C code), you might as well forget it.

Are some requests denied because the development effort is deemed too high, even when the enhancement would greatly extend the life of PV-WAVE and boost its marketability?

04-17-2009, 09:20 AM
Hi hcrisp,

Can you tell me the Change Request (CR) number of your request? We recently had a patch release and it's very possible that we addressed the CR.

04-28-2009, 09:14 AM
I seriously doubt that 9.01f addressed my change request. Is PV-WAVE still Motif based? I am waiting for the day when the Wave interface widgets look like a modern Windows application. VNI cannot even meet a request to enhance the file selection dialog (see this post: http://forums.vni.com/showthread.php?t=3139). Two people on this forum have already asked for it.

So I ask again: how does the enhancement request process work? How can I make sure that my request is addressed?

04-29-2009, 08:59 PM
You are correct, it is still Motif based.

I did take the liberty to search on the keywords you provided and found the CR (Customer Request # 001-00-016074) that you are referring to and there is only one request in our database for this feature. This is a single request related to changing the underlying widget set in PV-WAVE, but you bring up a subject that maybe we could investigate further within our customer base.

The process for enhancements is that they are all considered and prioritized based on overall applicability to our entire customer base, maintaining backward compatibility as much as possible, and the desires of our customers. Having said that may we contact you directly to follow up on your request?

Don B.