开发者

How can I build a histogram in 3D?

I have list of lists. Example:

A = Range[Range[N], 1]; where N = const. 

Then I fill lists.

That's mean the Length@A[[k]] are different; where k<=N.

How can I build开发者_Python百科 Histogram3D with this data?


Assuming you mean you're pre-binning the data, so you have a (ragged) array of heights:

heights = {{1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}, {1, 2, 3, 4, 5}}

Fill out the array into a rectangular form with something like:

heights = PadRight[#, 5] & /@ heights

Figure out what you bin boundaries are in each dimension (lengths will be one more than the number of bins):

x = Range[1,6,1]
y = Range[1,11,2]

Give the heights as a constant function:

Histogram3D[{{0, 0}}, {{x}, {y}}, heights &]

How can I build a histogram in 3D?

(The data in the first argument is fake since it's not actually used for anything.)


From your description, probably you want a BarChart (I may be wrong)

a = Table[i, {i, #}] & /@ Range[10]

BarChart3D[a, ChartLayout -> "Grid"]

How can I build a histogram in 3D?

Edit

If you really are looking for a 3D histogram:

a = Flatten[
  Table[RandomReal[NormalDistribution[i, .3], {10 i, 2}], {i, #}] & /@ Range[10], 1]  

Histogram3D@a  

How can I build a histogram in 3D?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜