0

I use

plt.savefig(os.path.basename(__file__)+".png", dpi=300)

to save my chart in matplolib. This is a result:

enter image description here

But I need it in full size. You can see difference in title. It is inside borders of chart. I need to save it in mode we know as "Maximized window" Is there an option to do this using plt.savefig?

enter image description here

DeepSpace
  • 153
  • 1
  • 2
  • 11
  • I am not sure this is a duplicate. I need to save it in mode we know as "Maximized window" – DeepSpace Jun 07 '19 at 18:37
  • Another relevant question is [this](https://stackoverflow.com/questions/12439588/how-to-maximize-a-plt-show-window-using-python). Check all the answers, one of them is using `savefig` – Sheldore Jun 07 '19 at 18:40
  • You can just go full screen and then click the little save icon at the bottom left. That's what I've done in the past – Reedinationer Jun 07 '19 at 18:52
  • Reedinationer, It is not suits for me because I need high resolution. I set dpi option for this. – DeepSpace Jun 07 '19 at 18:53
  • @DeepSpace FYI to ping another user in a comment, you need to `@` them like I did to you here. What has worked for me is to specify the figure size (i.e. `fig, ax = plt.subplots(figsize=(10, 5.8), constrained_layout=True)`) and then save as usual `plt.savefig("RiskPlot.png", bbox_inches="tight", dpi=1000)`. This is another possible solution. – Reedinationer Jun 07 '19 at 18:56

0 Answers0