TH2 with marginal projections

Hi Root experts,
is it possibile to create a TH2 with marginal projections similar to the jointplot in seaborn?
I know i could use pyROOT, but I was curious to know if it could be made in C++ using ROOT.

image

https://root.cern/doc/master/h2proj_8C.html

Thank you!