Filter löschen
Filter löschen

how to stack series in a 3-D bar chart

6 Ansichten (letzte 30 Tage)
Hugo
Hugo am 19 Okt. 2022
Bearbeitet: dpb am 19 Okt. 2022
Hi,
I would like to stack 3 series (a,b and c) in a single 3-D bar chart. However, the code that I have does not work properly. The code that I have right now is:
a=(rand(9,5))
b=(rand(9,5))
c=(rand(9,5))
bar3(a)
hold on
bar3(b)
hold on
bar3(c)
hold on
  1 Kommentar
dpb
dpb am 19 Okt. 2022
Bearbeitet: dpb am 19 Okt. 2022
Well, no, that code will simply put three regular 3D bar graphs on the same axes all on top of each other.
You're going to have to give more info about what you want, specifically to be stacked on top of what...can you sketch what you would like or show another graphic of a published paper that you're trying to duplicate?
bar3 is fairly limited in its capabilities; it is NOT a generalized bar of height against an arbitrary set of x,y coordinates; it can accept only a 2D array as its Z value...
See bar3 for the particulars, specifically there is an example of the 'Stacked' style it is capable of, but it is still using a 2D array and stacking the values summing the row values by column.
hist3 in Statistics TB will do the bivariate histogram that is a start, but it has no feature to stack additional bars on top of the previous to produce a stacked version.
Whether there's anything on FEX I don't know, haven't looked to see...

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by