Use Axes.set_aspect
in the following manner:
from matplotlib import pyplot as plt
plt.plot(range(5))
plt.xlim(-3, 3)
plt.ylim(-3, 3)
ax = plt.gca()
ax.set_aspect('equal', adjustable="box")
plt.draw()
More Related Contents:
- Adding value labels on a matplotlib bar chart
- Matplotlib discrete colorbar
- Purpose of “%matplotlib inline”
- Hiding axis text in matplotlib plots
- Moving x-axis to the top of a plot in matplotlib
- How to display custom values on a bar plot
- matplotlib: how to prevent x-axis labels from overlapping
- Matplotlib issue on OS X (“ImportError: cannot import name _thread”)
- How to change figuresize using seaborn factorplot
- Plotting the data with scrollable x (time/horizontal) axis on Linux
- How do you directly overlay a scatter plot on top of a jpg image in matplotlib / Python?
- Logarithmic y-axis bins in python
- Prevent scientific notation
- Plot logarithmic axes
- Generate a heatmap using a scatter data set
- How to prevent numbers being changed to exponential form in a plot
- How to set the subplot axis range
- sklearn plot confusion matrix with labels
- How to plot multiple bars grouped
- How to draw axis in the middle of the figure?
- Pandas and Matplotlib – fill_between() vs datetime64
- pandas – scatter plot with different color legend for each point
- new pythonic style for shared axes square subplots in matplotlib?
- iterating markers in plots
- matplotlib generic colormap from tab10
- How to do a scatter plot with empty circles in Python?
- How to draw grid lines behind matplotlib bar graph
- How to create a legend for 3D bar in matplotlib?
- How to remove/omit smaller contour lines using matplotlib
- Python: Matplotlib avoid plotting gaps