python pyplot用法_matplotlib.pyplot.plot()用法

Python–Matplotlib(基本用法)

python绘制三维图

579b8f3790903e63e8f1d5d2677d6ab6.png

画一条线plot(x,y3,color='#900302',marker='+',linestyle='-')

画多条线 plt.plot(x,y,"bo-",x,z,"g1--",x,m,"kv:")

"g1–"

颜色(color),点型(marker),线型(linestyle),

‘[color][marker][line]’

import numpy as np

from matplotlib import pyplot as plt

x = np.arange(1,11,2)

print(x)

y = np.sin(x)

z =2*np.cos(10*x)

m =2*x+3

plt.title("Matplotlib demo")

plt.xlabel("x axis caption")

plt.ylabel("测试")

plt.plot(x,y,"bo-",x,z,"g1--",x,m,"kv:")

plt.show()

============= ===============================

character 颜色(color)

============= ===============================

``'b'`` blue 蓝

``'g'`` green 绿

``'r'`` red 红

``'c'`` cyan 蓝绿

``'m'`` magenta 洋红

``'y'`` yellow 黄

``'k'`` black 黑

``'w'`` white 白

============= ===============================

============= ===============================

character 点型(marker)

============= ===============================

``'.'`` point marker

``','`` pixel marker

``'o'`` circle marker

``'v'`` triangle_down marker

``'^'`` triangle_up marker

``'

``'>'`` triangle_right marker

``'1'`` tri_down marker

``'2'`` tri_up marker

``'3'`` tri_left marker

``'4'`` tri_right marker

``'s'`` square marker

``'p'`` pentagon marker

``'*'`` star marker

``'h'`` hexagon1 marker

``'H'`` hexagon2 marker

``'+'`` plus marker

``'x'`` x marker

``'D'`` diamond marker

``'d'`` thin_diamond marker

``'|'`` vline marker

``'_'`` hline marker

============= ===============================

============= ===============================

character 线型(linestyle)

============= ===============================

``'-'`` solid line style 实线

``'--'`` dashed line style 虚线

``'-.'`` dash-dot line style 点画线

``':'`` dotted line style 点线

============= ===============================

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值