# Create a 2D histogram from two 1D histograms?

I’m having several problems with 2D histograms, but I think it might be easier to just create them from preexisting histograms than try to solve those problems.

Is there a way to create a 2D histogram from two 1D histograms?

Thanks!

[quote]I’m having several problems with 2D histograms, [/quote]What are they?

[quote]Is there a way to create a 2D histogram from two 1D histograms[/quote]It depends, what is the semantic that you are looking for?

Cheers,
Philippe

I’ve fixed all but one… I’m not sure how to make the range variable (with 1D I’m just setting both the min and max to 0 and it does the rest).

I’m plotting a 1D histogram of “energy1” and a 1D histogram of “energy2.” Then separately I want to plot energy2 as a function of energy1. I thought instead of filling the 2D histogram in a loop I could fill it all at once with vectors from the two 1D histograms (which would eliminate my variable range problem, too, as I could use the range of the two 1D histograms).

Thanks so much!