开发者

2D coordinates of Histogram3D from a given point of view

2D coordinates of Histogram3D from a given point of view

I found that plot on the web. I don`t know which kind of Distribution yields this. I w开发者_运维技巧ould like to draw such plot on paper. But get some help from Mathematica if possible :

With this image as example could I obtain the 2D coordinate of each visible bar edges of the plot?

I don`t know if it is purely edge detection of an image from a plot or if we could get this info from the plot itself.

Ideally I would adjust the image size to match my paper size and obtain the coordinates scaled. It would be incredible.

Thank You for your attention.


@500 If you simply want to draw a plot like this by hand, capture it and bring it into a drawing program as a stencil. Then draw over it on a different layer, while gridlines are on; finally, remove the picture and print it. It's an easy job to scale it to whatever size you wish. But it you want to explore how Mathematica works with it, read on.


Looks like you'll want to be using Histogram3D. (See documentation.)

Let's generate normally distributed data points (n= 10k) around means of 40 and 125 with standard deviations of 10 and 50, respectively and a Spearman rho of .45.

data = RandomVariate[BinormalDistribution[{40, 125}, {10, 50}, .45],  10^4]

You may grab data from FullForm if you like. That will give you the z-values.

Let's plot it using Histogram3D. We'll use bins of width 5 and 25 for x, y, respectively.

Histogram3D[data2, {{Table[10 + 5 k, {k, 15}]}, {Table[ 0 + 25 k, {k, 0, 12}]}}]

2D coordinates of Histogram3D from a given point of view


Edit:

When you mouse over a bar, the z-value will appear in a tooltip. So if you want to gather the data "by hand", you can do it that way. Alternatively, using FullForm you can look for Lists such as the following, which appear to contain the coordinates you are looking for. They appear to be in the List following CuboidBox but they may be the CuboidBox parameters. Someone should be able to clarify this.

List[Tooltip[
  StatusArea[
  List[RawBoxes[
  DynamicBox[
  List[FEPrivate`If[CurrentValue["MouseOver"], 
    EdgeForm[
     List[RGBColor[0.6666666666666666`, 0.6666666666666666`, 
       0.6666666666666666`], AbsoluteThickness[1.5`]]], List[], 
       List[]], 
       CuboidBox[List[15.`, 0.`, 0.`], List[20.`, 25.`, 10.`]]]]]], 
       10.`], Style[10.`, List[GrayLevel[0]]]]]

You could also use LabelingFunction to display the z-values, but this will not look good unless you are looking perpendicular to the x-y plane, in which case it might be better to use DensityPlot.

Histogram3D[data2, {{Table[10 + 5 k, {k, 15}]}, 
  {Table[0 + 25 k, {k, 0, 12}]}}, 
  LabelingFunction -> (Placed[Panel[#1, FrameMargins -> 0], Above] &)]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜