The iris example in default setting, it displays as follows.
using RDatasets, StatPlots
iris = dataset("datasets","iris")
@df iris marginalhist(:PetalLength, :PetalWidth)
Another examples.
The default one.
using StatPlots
c=10000; marginalhist(randn(c), randn(c))
To set mesh sizes more fine using by bins.
using StatPlots
c=100000; marginalhist(randn(c), randn(c), bins=50)