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

5
  • I am not sure this is a duplicate. I need to save it in mode we know as "Maximized window" Commented Jun 7, 2019 at 18:37
  • Another relevant question is this. Check all the answers, one of them is using savefig Commented Jun 7, 2019 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 Commented Jun 7, 2019 at 18:52
  • Reedinationer, It is not suits for me because I need high resolution. I set dpi option for this. Commented Jun 7, 2019 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. Commented Jun 7, 2019 at 18:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.