maxframe.dataframe.Series.plot.line#
- Series.plot.line(*args, **kwargs)#
将 Series 或 DataFrame 绘制为折线图。
此函数可用于使用 DataFrame 的值作为坐标来绘制折线图。
- 参数:
x (label or position, optional) -- 允许绘制一列相对于另一列的图形。如果未指定,则使用 DataFrame 的索引。
y (label or position, optional) -- 允许绘制一列相对于另一列的图形。如果未指定,则使用所有数值列。
color (str, array-like, or dict, optional) --
DataFrame 每一列的颜色。可能的值为:
A single color string referred to by name, RGB or RGBA code, for instance 'red' or '#a98d19'.
A sequence of color strings referred to by name, RGB or RGBA code, which will be used for each column recursively. For instance ['green','yellow'] each column's line will be filled in green or yellow, alternatively. If there is only a single column to be plotted, then only the first color from the color list will be used.
A dict of the form {column name : color}, so that each column will be colored accordingly. For example, if your columns are called a and b, then passing {'a': 'green', 'b': 'red'} will color lines for column a in green and lines for column b in red.
**kwargs -- 附加的关键字参数请参阅
DataFrame.plot()。
- 返回:
当
subplots=True时,返回一个 ndarray,其中每个列对应一个matplotlib.axes.Axes。- 返回类型:
matplotlib.axes.Axes or np.ndarray of them
参见
matplotlib.pyplot.plotPlot y versus x as lines and/or markers.
示例