Possible to make a scatter plot with margin histograms?

I’ve been trying to find some examples of this using plotly, but no luck so far. Would this be possible to do either using python, R or the JS plotly libraries?

Yes. Here’s an example https://plot.ly/~PlotBot/95.embed

JS code: https://plot.ly/~PlotBot/95.js

3 Likes

Hi Etiene… I am finding it very difficult to position a marginal graph on top of the main graph, as shown below.

In this example I made two different graphs. The histogram at the top and the scatter at the bottom. Is there a way to combine the two into one?

Does plotly subplots do what you need?

1 Like

Hi David. Thank’s for your help.

I believe that my need is more related to a marginal distribution https://plotly.com/python/marginal-plots/. However, I only found this solution in Python, not in JavaScript (Plotly JS).

Yes, I see your issue. This post by @AIMPED is also, strictly speaking a plotly Python one, but I wonder if it might give you a way forward: