Spec-Zone.ru › Matplotlib 2.2

matplotlib.pyplot.ylim

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

Получение или установка пределов оси Y текущего графика.

Подписи вызова функций:

ymin, ymax = ylim()  # return the current ylim
ylim((ymin, ymax))   # set the ylim to ymin, ymax
ylim(ymin, ymax)     # set the ylim to ymin, ymax

Если вы не указываете аргументы, вы можете альтернативно передать ymin или ymax как ключевые аргументы, т.е.:

ylim(ymax=3)  # adjust the max leaving min unchanged
ylim(ymin=1)  # adjust the min leaving max unchanged

Установка пределов отключает автоматическое масштабирование по оси Y.

Возвращаемое значение:
ymin, ymax

Кортеж новых пределов оси Y.

Примечания

Вызов этой функции без аргументов (например, ylim()) эквивалентен вызову get_ylim для текущей оси в pyplot. Вызов этой функции с аргументами эквивалентен вызову set_ylim для текущей оси в pyplot. Все аргументы передаются.

Примеры использования matplotlib.pyplot.ylim

../../_images/sphx_glr_step_demo_thumb.png

Пример ступенчатых графиков

../../_images/sphx_glr_errorbar_limits_simple_thumb.png

Пределы ошибки

../../_images/sphx_glr_ellipse_demo_thumb.png

Демонстрация эллипсов

../../_images/sphx_glr_usetex_fonteffects_thumb.png

Эффекты шрифтов с использованием Usetex

../../_images/sphx_glr_arrow_demo_thumb.png

Пример стрелок

../../_images/sphx_glr_integral_thumb.png

Интеграл как площадь под кривой

../../_images/sphx_glr_frame_grabbing_sgskip_thumb.png

Сбор кадров

../../_images/sphx_glr_findobj_demo_thumb.png

Демонстрация findobj

../../_images/sphx_glr_pyplot_thumb.png

Учебник по pyplot

© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/2.2.3/api/_as_gen/matplotlib.pyplot.ylim.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API