亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將“markersize”參數添加到 DataFrame 圖中?

如何將“markersize”參數添加到 DataFrame 圖中?

Cats萌萌 2021-12-17 14:41:47
我正在嘗試繪制 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)

輸出:

http://img1.sycdn.imooc.com//61bc31480001e74c03890266.jpg

查看完整回答
反對 回復 2021-12-17
  • 1 回答
  • 0 關注
  • 196 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號