Get current axis via plt.gca()
, and then set its limits:
ax = plt.gca()
ax.set_xlim([xmin, xmax])
ax.set_ylim([ymin, ymax])
More Related Contents:
- Is there a way to make a discontinuous axis in Matplotlib?
- Set Matplotlib colorbar size to match graph
- Scatter plot and Color mapping in Python
- How to plot multiple Seaborn Jointplot in Subplot
- How to add percentages on top of bars in seaborn
- Adding a background image to a plot
- Matplotlib and Ipython-notebook: Displaying exactly the figure that will be saved
- Non-ASCII characters in Matplotlib
- Matplotlib: How to plot images instead of points?
- How to set the default color cycle for all subplots with matplotlib?
- Reset color cycle in Matplotlib
- How to draw a line with matplotlib?
- How to plot line (polygonal chain) with numpy/scipy/matplotlib with minimal smoothing
- Matplotlib: how to make imshow read x,y coordinates from other numpy arrays?
- How can I save a Librosa spectrogram plot as a specific sized image?
- Python pandas / matplotlib annotating labels above bar chart columns [duplicate]
- Increase the speed of redrawing contour plot in matplotlib
- Using NetworkX with matplotlib.ArtistAnimation
- How to plot multiple dataframes to the same plot axes
- How to remove axis, legends, and white padding
- Plotting a stacked Bar Chart
- How to set common axes labels for subplots
- How can I rotate a matplotlib plot through 90 degrees?
- Automatically run %matplotlib inline in IPython Notebook
- How to plot time series in python
- matplotlib savefig performance, saving multiple pngs within loop
- Pandas Plotting Display all date values on x-axis (matplolib only displays few values) formatted as MMM-YYYY [duplicate]
- how to save a pylab figure into in-memory file which can be read into PIL image?
- How to center labels in histogram plot
- Broken axis example: uneven subplot size