假设我有以下代码使用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')

如何在保留我使用特定颜色图的能力的同时轻松设置x和y标签?我注意到,plot()pandas DataFrames 的包装没有采用任何特定于此的参数。




pd.plot()?考虑到pd.plot()over 的其他简洁性,plt.plot()使它变得更加简洁而不需要调用就显得很有道理ax.set_ylabel()。