help-octave
[Top][All Lists]
Advanced

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

Re: labels in categorical bar graph


From: Brett Green
Subject: Re: labels in categorical bar graph
Date: Thu, 31 Oct 2019 10:51:11 -0400

On Thu, Oct 31, 2019 at 3:12 AM Raag Saluja <address@hidden> wrote:
Hi! 

I tried making a bar graph with categorical data. However, the labels of the categories are not coming below the bars. Can you please help?

This is the code I used:

P = -2,920,000 -2,936,000 -2,935,000 -2,937,000 -2,939,000 -2,938,000

bar(P)

set(gca,"xticklabel",{'1JFF','α1aβII', 'α1aβIII', 'α1bβII', 'α1bβIII', 'α8β8'});


PFA a screenshot of the output.

Thank you and regards,
Raag Saluja
Research Scholar
Department of Zoology
Faculty of Science
Dayalbagh Educational Institute
INDIA

This is what you want:

P = [-2920000 -2936000 -2935000 -2937000 -2939000 -2938000];
bar(P)
set(gca,"xticklabel",{'1JFF','\alpha 1a\beta II','\alpha 1a\betaIII','\alpha 1b\beta II','\alpha 1b\beta III','\alpha 8\beta 8'});
 
Commas separate elements in arrays, or function arguments, or things like that. They should never be used to mark thousands, millions, etc. in code. If you check the axes on your graph, you'll notice that the tall bars are positive, whereas the numbers you entered are positive. You can also see a small negative bar for each -2. The spaces are from the 000 entries, and the tall bars are form the 9xx entries.

reply via email to

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