Matplotlib axes类

简介: Matplotlib axes类
import matplotlib.pyplot as plt
y = [1, 4, 9, 16, 25,36,49, 64]
x1 = [1, 16, 30, 42,55, 68, 77,88]
x2 = [1,6,12,18,28, 40, 52, 65]
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
#使用简写的形式color/标记符/线型
l1 = ax.plot(x1,y,'ys-') 
l2 = ax.plot(x2,y,'go--') 
ax.legend(labels = ('tv', 'Smartphone'), loc = 'lower right') # legend placed at lower right
ax.set_title("Advertisement effect on sales")
ax.set_xlabel('medium')
ax.set_ylabel('sales')
plt.show()
目录
相关文章
|
3天前
matplotlib.pyplot contourf()函数的使用
matplotlib.pyplot contourf()函数的使用
|
3天前
|
编解码 IDE 开发工具
【Matplotlib】figure方法 你真的会了吗!?
【Matplotlib】figure方法 你真的会了吗!?
112 1
|
4天前
|
Python
Matplotlib subplot()函数
Matplotlib subplot()函数
15 1
|
4天前
|
Python
Matplotlib figure图形对象
Matplotlib figure图形对象
54 1
|
4天前
|
Python
Matplotlib.pyplot绘图示例
Matplotlib.pyplot绘图示例
30 0
|
11月前
|
编解码 数据可视化 数据挖掘
【Matplotlib】绘制图形
【Matplotlib】绘制图形
146 0
|
Python
Matplotlib从入门到精通:Axes与Axis(二)
Matplotlib从入门到精通:Axes与Axis
100 0
Matplotlib从入门到精通:Axes与Axis(二)
|
Python
Matplotlib从入门到精通:Axes与Axis(一)
Matplotlib从入门到精通:Axes与Axis
112 0
Matplotlib从入门到精通:Axes与Axis(一)
|
关系型数据库 Python
Matplotlib从入门到精通:Axes与Axis(三)
Matplotlib从入门到精通:Axes与Axis
150 0
Matplotlib从入门到精通:Axes与Axis(三)