help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: categorical bar graph


From: Brett Green
Subject: Re: categorical bar graph
Date: Tue, 29 Oct 2019 08:25:17 -0400

You're welcome!

- Brett Green

On Tue, Oct 29, 2019, 8:17 AM Raag Saluja <address@hidden> wrote:
Thank you so much! 

On Tue, Oct 29, 2019 at 5:35 PM Brett Green <address@hidden> wrote:
On Tue, Oct 29, 2019, 7:57 AM Raag Saluja <address@hidden> wrote:
What do I do if I want to make subplots, with the same xticklabels, please? I tried this:

y1= [5 2 3 1];

y2= [3 2 2 1];

subplot(2,2,1),bar(y1),subplot(2,2,2),bar(y2)

set(gca,"xticklabel",{'small', 'medium', 'large', 'extra large'});


PFA a screenshot of the output I got.


I'm not at my computer at the moment, but this should do it:

y1= [5 2 3 1];
y2= [3 2 2 1];
subplot(2,2,1)
bar(y1)
set(gca,"xticklabel",{'small', 'medium', 'large', 'extra large'});
subplot(2,2,2)
bar(y2)
set(gca,"xticklabel",{'small', 'medium', 'large', 'extra large'});

gca returns the current axes. It refers to the first plot's axes until you create the second plot. Then it refers to the second plot's axes.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]