You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a fix for it? I'd like to be able to save my figs in higher dpi. But for some reason it only saves as a dark rectangle of the background color.
The text was updated successfully, but these errors were encountered:
If I'm understanding your problem correctly, I was getting the exact same issue and intermittently - some charts generated fine, some had the cyberpunk-styled background and line objects but the chart area, axis text, title were not cyberpunk-styled:
Other charts looked well:
My setup was using a multiprocessing Pool() object to build many charts at once.
On each process, the following code was run:
fig, ax = pl.subplots(figsize=(15, 8))
if self.dark_mode:
pl.style.use("cyberpunk")
else:
pl.style.use("bmh")
To fix the issue, I simply moved the fig, ax assignment below the pl.style.use block:
if self.dark_mode:
pl.style.use("cyberpunk")
else:
pl.style.use("bmh")
fig, ax = pl.subplots(figsize=(15, 8))
For some reason doing the pl.style.use command only once before the Pool().starmap() didn't work. Presumably, each spawned process works with a fresh unaltered instance of matplotlib - this is speculation, my understanding here is not good.
Is there a fix for it? I'd like to be able to save my figs in higher dpi. But for some reason it only saves as a dark rectangle of the background color.
The text was updated successfully, but these errors were encountered: