mihirkatare / DeepMEM

Deep Learning Implementations for Sustainable Matrix Element Method Calculations [ IRIS-HEP Fellowship ]
Apache License 2.0
2 stars 0 forks source link

Use matplotlib object oriented API for non-interactive plotting #14

Open matthewfeickert opened 2 years ago

matthewfeickert commented 2 years ago

In another PR (no need to add more things for this one :+1:) as no interactive visualization is being done with matplotlib it would probably be better to use the OO API for this.

e.g.

from matplotlib.figure import Figure

fig = Figure()
ax = fig.subplots()

ax.hist(...)
ax.set_xlabel(r"$-\log_{10}\,($Drell-Yan MoMEMta Weights$)$")
... 

For a bit of the motivations c.f. https://gist.github.com/matthewfeickert/84245837f09673b2e7afea929c016904 as this is related to matplotlib backends being set to work with or disallow GUIs.

Originally posted by @matthewfeickert in https://github.com/mihirkatare/DeepMEM/pull/12#r693062103