Answers for "remove the blank space from a matplotlib figure"

0

remove whitespace around figure matplotlib

plt.gca().set_axis_off()
plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, 
            hspace = 0, wspace = 0)
plt.margins(0,0)
plt.gca().xaxis.set_major_locator(plt.NullLocator())
plt.gca().yaxis.set_major_locator(plt.NullLocator())
plt.savefig("filename.pdf", bbox_inches = 'tight',
    pad_inches = 0)

# contributor was unsure about how it works, but nonetheless, it works!
Posted by: Guest on June-14-2021
-1

remove space in print python

age = 20
print("My age is ", age, '.', sep='')
Posted by: Guest on June-17-2021

Code answers related to "remove the blank space from a matplotlib figure"

Python Answers by Framework

Browse Popular Code Answers by Language