Python用于数据分析中的数据可视化(matplotlib)
发布时间
阅读量:
阅读量
import matplotlib.pyplot as plt
import numpy as np
import numpy.random as randn
import pandas as pd
from pandas import Series,DataFrame
from pylab import mpl
mpl.rcParams['axes.unicode_minus'] = False # 我自己配置的问题
plt.rc('figure', figsize=(10, 6)) # 设置图像大小
AI写代码python
运行
%matplotlib inline
AI写代码python
运行
1. figure对象
所有通过Matplotlib生成的图像均归属于figure对象进行管理。
- 初始化figure: 调用plt.figure()函数实现
fig = plt.figure()
AI写代码python
运行
2. subplot子图
- add_subplot:用于在figure对象中插入子图。
全部评论 (0)
还没有任何评论哟~
