matplotlib画直线
来源:互联网 发布:java equals string 编辑:程序博客网 时间:2024/06/05 02:50
使用matplotlib画两条直线:
Code :
from matplotlib.lines import Line2Dimport matplotlib.pyplot as pltfigure, ax = plt.subplots()# 设置x,y值域ax.set_xlim(left=0, right=20)ax.set_ylim(bottom=0, top=10)# 两条line的数据line1 = [(1, 1), (5, 5)]line2 = [(11, 9), (8, 8)](line1_xs, line1_ys) = zip(*line1)(line2_xs, line2_ys) = zip(*line2)# 创建两条线,并添加ax.add_line(Line2D(line1_xs, line1_ys, linewidth=1, color='blue'))ax.add_line(Line2D(line2_xs, line2_ys, linewidth=1, color='red'))# 展示plt.plot()plt.show()
Output :
0 0
- matplotlib画直线
- matplotlib绘制等直线
- 入手python绘图包:matplotlib,画直线、画抛物线
- 如何在matplotlib中两个坐标轴之间画一条直线光标
- matplotlib初试——求两条直线相交的大概位置
- 画直线
- 画直线
- Matplotlib 画柱状图
- matplotlib画动态散点图
- 用 matplotlib 画等高线
- Matplotlib 画柱状图等
- Matplotlib画折线图
- matplotlib画矩形框
- matplotlib画二维分布图
- MatPlotLib
- matplotlib
- matplotlib
- matplotlib
- 蓝桥杯BASIC_23(芯片测试)
- JAVA中字符串长度与字节
- java的初始化顺序
- C++ 中error: ‘exit’ was not declared in this scope 的解决方法
- python3中的变量理解
- matplotlib画直线
- 蓝牙的Baseband说明
- Freeline 让AndroidStudio快的飞起来
- Sqoop进行MySQL和Hive间的导入导出操作
- 实验作业 锁屏应用一
- 在Kettle里使用参照表进行数据校验(子转换实现)
- storm技术架构讲解之storm对比hadoop
- Eclipse安装内存分析工具(Memory Analyzer)
- foreach循环