Skip to content
Advertisement

Python – Reduce the plot axis size

I want to reduce the axis size of this diagram that I have plotted. As you see the (0.7 ; 1.0) part is useless on both axis and I want to remove them so the diagram is well centered and takes all the plot.

enter image description here

Here is the part of my code for the plotting :

# Annotating the plot.

plt.plot(U, V, 'o-', color='white', mec='black')
plt.annotate(patch_sd.name.title(),
             xy=UV,
             xytext=(-50, 30),
             textcoords='offset points',
             arrowprops=dict(arrowstyle='->', connectionstyle='arc3, rad=0.2'))

# Displaying the plot.

render(
    standalone=True,
    limits=(-0.1, 0.9, -0.1, 0.9),
    x_tighten=True,
    y_tighten=True)

Thank you !

Advertisement

Answer

plt.xlim(0, 0.5)
plt.ylim(0, 0.5)
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement