matplotlib 当中 线段、标记、颜色的可选值

 
  

================    ===============================
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

   r                红色   g                绿色   b                蓝色   c                青蓝色   m                品红色   y                黄色   k                黑色   w                白色
================    ===============================


可以使用下面的语句来画出特定线段、标记、颜色的图形,两个语句效果一样

plt.plot(range(10), linestyle='--', marker='o', color='b')
plt.plot(range(10), '--bo')


参考:

https://stackoverflow.com/questions/8409095/matplotlib-set-markers-for-individual-points-on-a-line

https://cn.mathworks.com/help/matlab/ref/linespec.html?requestedDomain=true

你可能感兴趣的:(matplotlib 当中 线段、标记、颜色的可选值)