I am plotting a graph in my jupyter notebook like this:
fig3, ax3 = plt.subplots()
color = 'tab:red'
ax3.set_xlabel('active learning cycles')
ax3.set_ylabel('amount', color=color)
ax3.plot(al_cycle_count, al_bbs_count, color=color)
ax3.plot(al_cycle_count, ccs, color=color, dashes=[6, 2])
ax3.tick_params(axis='y', labelcolor=color)
ax4 = ax3.twinx() # instantiate a second axes that shares the same x-axis
ax4.set_ylabel('% (1 = 100%)')
ax4.plot(al_cycle_count, precisions)
ax4.plot(al_cycle_count, recalls)
ax4.plot(al_cycle_count, f1s)
ax3.set(title='performance of "' + experiment_name + '"')
fig3.legend(['Bounding Boxen', 'Learning Steps', 'Precision', 'Recall', 'F1'], loc='upper right', bbox_to_anchor=(0.35, 0.9))
#fig3.tight_layout() # otherwise the right y-label is slightly clipped
plt.show()
And the output looks like this:
Once i save.fig the plot, the legends gets squeezed into the plot and the name cut off (it is obviously too long, i know)
Can i somehow control the saved plot and how could i better place the legends without it hiding information of the plot?


fig.savefig("name.pdf", bbox_inches="tight")gives a similar figure than the one shown in the notebook.