I'm trying to plot an histogram of a set of data, I would like to use a bin of different width in x and y direction.

I've tried using the following two codes:

Histogram3D[data, {0.2, 0.098}, "PDF"]


Histogram3D[data, {{0.2, 0.098}}, "PDF"]

However the code is not working.

I know it's a basic question, but does anybody have any suggestion?


1 Answer 1


Tak a closer look at documentation:

data = RandomReal[1, {100, 2}];

Histogram3D[data, {{.2}, {.5}}]

enter image description here

The following bin specifications bpsec can be given:

{w} use bins of width w


{xspec,yspec} give different x and y specifications


{{wx}, {wy}}
  • $\begingroup$ The specification should give an example of the usage. This post explains how to use it far quicker than decoding the documentation. All the documentation needs is a single example. Using the braces twice for example is confusing. $\endgroup$
    – apg
    Commented Mar 6 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.