The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How do I insert values into my bar plot (with 2 columns per x

Replies: 1   Last Post: Jan 29, 2013 5:24 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  

Posts: 9,850
Registered: 6/7/07
Re: How do I insert values into my bar plot (with 2 columns per x

Posted: Jan 29, 2013 5:24 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/29/2013 3:17 PM, Chris wrote:
> If I have a vector A and matrix B and make a bar plot, how do I list the
> corresponding y values at the top of each bar? (I understand that you
> use the text() function but I cannot get it to work). An example of what
> I want to accomplish:
> A = [1 2 3 4 5];
> B = [4 7; 2 9; 3 7; 4 8; 1 3];
> bar(A,B);
> % how do I properly use text() or something else to insert the data
> values located in B??



at the command line for example. You can then clearly use a loop or
even vectorize the idea for the general case.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.