python中figure函数_Python Matplotlib.figure.Figure.autofmt_xdate()用法及代码示例

Matplotlib是Python中的一个库,它是数字的-NumPy库的数学扩展。 Figure模块提供了顶层Artist,即Figure,其中包含所有绘图元素。此模块用于控制所有图元的子图和顶层容器的默认间距。

matplotlib.figure.Figure.autofmt_xdate()函数

matplotlib库的autofmt_xdate()方法图形模块用于旋转它们并使其右对齐。

用法: autofmt_xdate(self, bottom=0.2, rotation=30, ha=’right’, which=None)

参数:这接受以下描述的以下参数:

bottom:此参数是subplots_adjust()子图的底部。

rotation:此参数是xtick标签的旋转。

ha:此参数是xticklabels的水平对齐方式。

which:此参数选择要旋转的刻度标签。

返回值:此方法不返回任何值。

以下示例说明了matplotlib.figure中的matplotlib.figure.Figure.autofmt_xdate()函数:

范例1:

# Implementation of matplotlib function

import numpy as np

import matplotlib.pyplot as plt

import matplotlib.dates as mdates

import matplotlib.cbook as cbook

years = mdates.YearLocator()

months = mdates.MonthLocator()

year

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值