python之plt画图之格式化颜色和线形
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python之plt画图之格式化颜色和线形相关的知识,希望对你有一定的参考价值。
import matplotlib.pyplot as plt
在ipython中输入 plt.plot?
The following format string characters are accepted to control
the line style or marker:
================ ===============================
character description
================ ===============================
``‘-‘`` solid line style
``‘--‘`` dashed line style
``‘-.‘`` dash-dot line style
``‘:‘`` dotted line style
``‘.‘`` point marker
``‘,‘`` pixel marker
``‘o‘`` circle marker
``‘v‘`` triangle_down marker
``‘^‘`` triangle_up marker
``‘<‘`` triangle_left 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
================ ===============================
The following color abbreviations are supported:
========== ========
character color
========== ========
‘b‘ blue
‘g‘ green
‘r‘ red
‘c‘ cyan
‘m‘ magenta
‘y‘ yellow
‘k‘ black
‘w‘ white
========== ========
以上是关于python之plt画图之格式化颜色和线形的主要内容,如果未能解决你的问题,请参考以下文章
不同label样本画图——颜色分配plt.cm.Spectral