2D Histograms directly from two branches in the rootfile

I have two trees in my root file, named ncandidates and events. How do I plot a histogram with ncandidates on the x axis and events on the y axis by writing a command directly on the terminal instead of the ROOT macro?

Search for “friend” and “alias” in the TTree class reference.

See also: ROOT User’s Guide -> Trees -> Example 3: Adding Friends to Trees