相关疑难解决方法(0)

将x和y标签添加到pandas图中

假设我有以下代码使用pandas绘制非常简单的东西:

import pandas as pd
values = [[1, 2], [2, 5]]
df2 = pd.DataFrame(values, columns=['Type A', 'Type B'], 
                   index=['Index 1', 'Index 2'])
df2.plot(lw=2, colormap='jet', marker='.', markersize=10, 
         title='Video streaming dropout by category')
Run Code Online (Sandbox Code Playgroud)

产量

如何在保留使用特定色彩映射的能力的同时轻松设置x和y标签?我注意到plot()pandas DataFrames 的包装器没有采用任何特定的参数.

python matplotlib dataframe pandas

153
推荐指数
7
解决办法
22万
查看次数

标签 统计

dataframe ×1

matplotlib ×1

pandas ×1

python ×1