【问题标题】:How do I increase the thickness of a line and size of the marker head for a stem plot in Matplotlib?如何为 Matplotlib 中的茎图增加线条的粗细和标记头的大小?
【发布时间】:2022-01-12 15:12:59
【问题描述】:

我正在尝试创建一个主干图。我似乎找不到增加线条粗细和标记头大小的方法。

请找到下面写的基本代码。任何帮助将不胜感激。

x = dataset['Month']
y = dataset['Total B']

plt.stem(x,y, linefmt='--')
plt.show()

【问题讨论】:

标签: python matplotlib


【解决方案1】:

我在这里找到了答案:

How do I increase the thickness of a line and size of the marker head for a stem plot in Matplotlib?

markerline, stemline, baseline, = ax.stem(x,y,linefmt='k-',markerfmt='ko',basefmt='k.') plt.setp(茎线,线宽 = 1.25) plt.setp(markerline,markersize = 5)

【讨论】:

  • 你链接到你自己的问题?
猜你喜欢
  • 2017-07-25
  • 2011-07-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-08
相关资源
最近更新 更多