How can I generate 3D bar graph for multidimensional matrix?
Show older comments
Hello,
I am trying to plot a 3D bar graph where I am using y as multidimensional matrix. While trying to execute command bar3(x,y), it shows me an error "Inputs must be 2-D". Will you please help me solving this?
Thank you.
Harsh
3 Comments
Chad Greene
on 20 Jan 2015
How can only one dimension (as you say the 3rd dimension) be used represent a multidimensional matrix?
Harsh
on 21 Jan 2015
Chad Greene
on 21 Jan 2015
If your y is three dimensional, it contains a dependent value corresponding to every combination of three independent variables. In a bar3 chart, bar height represents each y value, and bars are positioned with their bases on a 2D plane. That 2D plane corresponds to only two of your three independent variables. How do you want your third independent variable to be represented? You've run out of spatial dimensions, so perhaps time (an animation) or maybe color?
I recommend drawing a picture of what you want your final product to look like. Label every dimension. If you still need help, upload that picture and a .mat file containing your data.
Answers (0)
Categories
Find more on Bar Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!