- Code: Select all
plt.axis('off')
However this removes everything, labels etc, and just leaves you with the main plot. If you use the following it just removes the frame.
Just replace the final block of code starting with:
- Code: Select all
# Output the file
with this:
- Code: Select all
# Output the file
plt.tight_layout()
plt.gca().spines['top'].set_visible((False))
plt.gca().spines['bottom'].set_visible((False))
plt.gca().spines['left'].set_visible((False))
plt.gca().spines['right'].set_visible((False))
plt.savefig(output_file, **k_plot_fig)
plt.close()