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:
- Why we use plt in general not the name of the object? [closed]
- Plot a function in python
- Generate a heatmap in MatPlotLib using a scatter data set
- Is it possible to plot implicit equations using Matplotlib?
- Can I make a multi-color line in matplotlib?
- What is the difference between drawing plots using plot, axes or figure in matplotlib?
- Intersection of two graphs in Python, find the x value
- Set markers for individual points on a line in Matplotlib
- How can I plot a confusion matrix? [duplicate]
- How to set xlim and ylim for a subplot in matplotlib [duplicate]
- Save a subplot in matplotlib
- How to plot a histogram using Matplotlib in Python with a list of data?
- Pyplot: vertical gradient fill under curve?
- imshow(img, cmap=cm.gray) shows a white for 128 value
- Plot curve with blending line colors with matplotlib/pyplot
- automatically position text box in matplotlib
- Specifying the order of matplotlib layers
- Add legends to LineCollection plot
- Plot yerr/xerr as shaded region rather than error bars
- White lines in matplotlib’s pcolor
- Removing axes margins in 3D plot
- Adding colors to a 3d quiver plot in matplotlib
- create heatmap2d from txt file
- AttributeError while adding colorbar in matplotlib
- How I can get cartesian coordinate system in matplotlib?
- Using Sympy Equations for Plotting
- Remove axis label offset by default
- Multiple datasets on the same scatter plot
- Interactive matplotlib figures in Google Colab
- Matplotlib Errorbar Caps Missing