【问题标题】:how can show markers in matplotlib如何在 matplotlib 中显示标记
【发布时间】:2022-08-04 16:01:34
【问题描述】:

我做了一个情节,但在我的情节中,我只能展示我的几个标记

x_time = chine[\"time\"].copy()


x = chine.drop(\"time\", axis=1)

y_static = chine[\"static\"].copy()
plt.plot(x_time, y_static, marker=\'o\', label=\'static\')
y_stirring = chine[\"stirring\"].copy()
plt.plot(x_time, y_stirring, marker=\'v\', label=\'stirring\')
y_ultrasound = chine[\"ultrasound\"].copy()
plt.plot(x_time, y_ultrasound, marker=\'.\', label=\'ultrasound\')

plt.legend()
plt.xlabel(\"time\")

enter image description here

当我更改订单时,结果发生了变化,但我无法显示其他标记 enter image description here

  • 你说的标记是什么意思?你是指图表上的点吗?
  • 是的,我的意思是积分。
  • 我的回答有帮助吗?注意:使用 marker=\".\" 将导致没有标记出现
  • 也许尝试使用其他标记

标签: python matplotlib plot jupyter-notebook marker


【解决方案1】:

如果你想展示你的观点,你别无选择,只能使用:

plt.plot(..., marker="o")

他们应该清楚地显示图表上的点。如果不是,则意味着您的数据点太少。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-01
    相关资源
    最近更新 更多