我正在尝试绘制 DataFrame 并且我想修改标记大小,但似乎我无法在同一个 plot() 调用中执行此操作。ax0 = df_can_t.plot(kind='scatter', x='Year', y='China', \
figsize=(30,10), color = 'red', marker= '+', markersize = 14.0)我收到错误:AttributeError:未知属性标记大小。但是,似乎允许使用“标记大小”(https://matplotlib.org/api/_as_gen/matplotlib.pyplot.plot.html),所以我不确定问题是什么。
1 回答

qq_花开花谢_0
TA贡献1835条经验 获得超7个赞
使用scatter plot,您的大小参数只是s,请尝试:
ax0 = df_can_t.plot(kind='scatter', x='Year', y='China', \
figsize=(30,10), color = 'red', marker= '+', s = 14.0)
这是一个MVCE:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = sns.load_dataset('iris')
ax = df.plot(kind='scatter', x='petal_width', y='sepal_width', s=10.0)
输出:
添加回答
举报
0/150
提交
取消