Thread Subject: bar3 renormalized rows ??

Subject: bar3 renormalized rows ??

From: Juliette Salexa

Date: 10 Aug, 2009 01:10:05

Message: 1 of 3

In bar3, if for example each row of bars has one bar that's higher than the rest in that row, and the height of these highest bars is very different in each row, chances are that you'll only see the global highest bar, and the rest of the bars will all look almost null.

But what if we want to see at least the highest bar of each row ??
The scale of each row will have to be renormalized to the scale of its highest bar.
Much like plotyy('x1','y1','x2','y2',@bar) except instead of 2 y-scales, EACH ROW has a separate z-scale.

I looked through the matlab documentation of bar3 and on the FEX for something that does this.

Before starting to write a function to do this, I thought I'd first double check if anyone's seen something like this on FEX (or internal to matlab) .. just to make sure I'm not wasting my time. Because it seems like something MANY people have had to do before.

Also, if you have looked for something like this unsuccessfully, then I would also appreciate you telling me so!

Subject: bar3 renormalized rows ??

From: us

Date: 10 Aug, 2009 06:34:02

Message: 2 of 3

"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h5ns1d$5ku$1@fred.mathworks.com>...
> In bar3, if for example each row of bars has one bar that's higher than the rest in that row, and the height of these highest bars is very different in each row, chances are that you'll only see the global highest bar, and the rest of the bars will all look almost null.
>
> But what if we want to see at least the highest bar of each row ??
> The scale of each row will have to be renormalized to the scale of its highest bar.
> Much like plotyy('x1','y1','x2','y2',@bar) except instead of 2 y-scales, EACH ROW has a separate z-scale.
>
> I looked through the matlab documentation of bar3 and on the FEX for something that does this.
>
> Before starting to write a function to do this, I thought I'd first double check if anyone's seen something like this on FEX (or internal to matlab) .. just to make sure I'm not wasting my time. Because it seems like something MANY people have had to do before.
>
> Also, if you have looked for something like this unsuccessfully, then I would also appreciate you telling me so!

one of the solutions

     m=reshape(1:3*4,[3,4]);
     subplot(1,2,1);
     bar3(m);
     subplot(1,2,2);
     mn=bsxfun(@rdivide,m,max(m));
     bar3(mn);

us

Subject: bar3 renormalized rows ??

From: Juliette Salexa

Date: 10 Aug, 2009 20:45:20

Message: 3 of 3

Thank you us,
Maybe I should have been more specific.

My code does what yours does (although I must admit, in a less compact way!), but I want the z-axes to have different scales (that's what I meant by plotyy('x','y',x','y',@bar) making two y-axes and the need for a different z-axes for each row).

What I'd like to do is have a vertical line for each row (instead of just one), and the scale on that particular line appropriate for that row's scaling.

If this has never been done, and can't be done internally in matlab, I'll write a funciton and put it on the FEX.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
code us 10 Aug, 2009 02:39:04
bar3 us 10 Aug, 2009 02:39:04
bsxfun us 10 Aug, 2009 02:39:04
rssFeed for this Thread

Contact us at files@mathworks.com