GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Plot types
  • User guide
  • Tutorials
  • Examples
  • Reference
  • Contribute
  • Releases
  • Gitter
  • Discourse
  • GitHub
  • matplotlib
  • matplotlib.animation
  • matplotlib.animation.Animation
  • matplotlib.animation.FuncAnimation

This view

  • Original page
  • New address

GeezerVison is showing matplotlib.org — matplotlib.pyplot.ylim — Matplotlib 3.11.2 documentation

matplotlib.pyplot.ylim#

matplotlib.pyplot.ylim(*args, **kwargs)[source]#

Get or set the y-limits of the current Axes.

Call signatures:

bottom, top = ylim()  # return the current ylim
ylim((bottom, top))   # set the ylim to bottom, top
ylim(bottom, top)     # set the ylim to bottom, top

If you do not specify args, you can alternatively pass bottom or top as kwargs, i.e.:

ylim(top=3)  # adjust the top leaving bottom unchanged
ylim(bottom=1)  # adjust the bottom leaving top unchanged

Setting limits turns autoscaling off for the y-axis.

Returns:
bottom, top

A tuple of the new y-axis limits.

Notes

Calling this function with no arguments (e.g. ylim()) is the pyplot equivalent of calling get_ylim on the current Axes. Calling this function with arguments is the pyplot equivalent of calling set_ylim on the current Axes. All arguments are passed though.

Examples using matplotlib.pyplot.ylim#

Frame grabbing

Frame grabbing

Interactive functions

Interactive functions

Findobj Demo

Findobj Demo

Pyplot tutorial

Pyplot tutorial
On this page
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.