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()
目录
相关文章
|
2月前
matplotlib.pyplot contourf()函数的使用
matplotlib.pyplot contourf()函数的使用
|
2月前
|
编解码 IDE 开发工具
【Matplotlib】figure方法 你真的会了吗!?
【Matplotlib】figure方法 你真的会了吗!?
100 1
|
4月前
|
存储 数据可视化 Serverless
一篇文章学会Matplotlib
一篇文章学会Matplotlib
22 1
|
4月前
|
Python
Matplotlib subplot()函数
Matplotlib subplot()函数
15 1
|
4月前
|
Python
Matplotlib figure图形对象
Matplotlib figure图形对象
52 1
|
5月前
|
Python
Matplotlib.pyplot绘图示例
Matplotlib.pyplot绘图示例
27 0
|
5月前
|
数据可视化 数据挖掘 Python
matplotlib
matplotlib 是一个用于绘制高质量图形的 Python 库。它提供了多种绘图函数和图表类型,如折线图、散点图、柱状图、饼图等,以及自定义图形的强大功能。matplotlib 还可以与 pandas 和 numpy 等其他 Python 库无缝集成。
25 2
|
9月前
|
前端开发 数据可视化 Python
初识【Matplotlib】
初识【Matplotlib】
58 0
|
大数据 Python
matplotlib Basemap的3d效果
matplotlib Basemap的3d效果
110 0
|
关系型数据库 Python
Matplotlib从入门到精通:Axes与Axis(三)
Matplotlib从入门到精通:Axes与Axis
147 0
Matplotlib从入门到精通:Axes与Axis(三)