lineplot#
- cfplot.lineplot(f=None, x=None, y=None, fill=True, lines=True, line_labels=True, title=None, ptype=0, linestyle='-', linewidth=1.0, color=None, xlog=False, ylog=False, verbose=None, swap_xy=False, marker=None, markersize=5.0, markeredgecolor='k', markeredgewidth=0.5, label=None, legend_location='upper right', xunits=None, yunits=None, xlabel=None, ylabel=None, xticks=None, yticks=None, xticklabels=None, yticklabels=None, xname=None, yname=None, axes=True, xaxis=True, yaxis=True, titles=False, zorder=None)[source]#
Create a line (graph) plot with optional markers.
The minimum usage is
lineplot(f), where f is a CF field. If x and y are provided, appropriate plots can be made, including x-versus-data and y-versus-data plots.When making a labelled line plot, always provide a label for each line and specify the legend location in the final call to
lineplot.- When making a multiple-line plot:
Set the axis limits with
gsetbefore plotting the lines.Place any axis overrides described below in the final call to
lineplot.
Note
Use
cfplot.scatter()to create a scatter plot without connecting lines.- Parameter breakdown (see below for full detail). The following parameters:
- specify the input data:
f,x,y
- set the verbosity to toggle log level:
verbose
- configure the line appearance and markers:
linestyle,color,linewidth,marker,markersize,markeredgecolor,markeredgewidth,zorder
- configure the x- and y-axis scales:
xlog,ylog
- configure line labels and the legend:
label,legend_location
- control titles:
titles
- override the defaults derived from CF data:
title,axes,xunits,yunits,xlabel,ylabel,xticks,yticks,xticklabels,yticklabels,xaxis,yaxis
- specify deprecated parameters:
xname,yname
- Parameters:
f -- CF data used to make a line plot.
x -- x-coordinates of the data in y.
y -- y-coordinates of the data in x.
verbose -- Set to
1to display a verbose listing of the operations performed bylineplot.linestyle -- Line style. Defaults to
'-'.color -- Line colour. Defaults to Matplotlib's colour scheme unless explicitly specified.
linewidth -- Line width. Defaults to
1.0.marker -- Marker style for points along the line. Defaults to
None.markersize -- Marker size. Defaults to
5.0.markeredgecolor -- Colour of the marker edge. Defaults to
'k'.markeredgewidth -- Width of the marker edge. Defaults to
0.5.zorder -- Plotting order. Defaults to
None.xlog -- If
True, use a logarithmic x-axis.ylog -- If
True, use a logarithmic y-axis.label -- Label for the line. Defaults to
None.legend_location --
Location of the legend. Defaults to
'upper right'. The available options are:Value
Location
'best'Best location (automatically determined)
'center'Centre
'center left'Centre left
'center right'Centre right
'lower center'Lower centre
'lower left'Lower left
'lower right'Lower right
'right'Right
'upper center'Upper centre
'upper left'Upper left
'upper right'Upper right
titles -- If
True, display a dimensions title.title -- Plot title. Defaults to
None.axes -- If
True, display the x- and y-axes.xunits -- x-axis units. Defaults to
None.yunits -- y-axis units. Defaults to
None.xlabel -- x-axis label. Defaults to
None.ylabel -- y-axis label. Defaults to
None.xticks -- x-axis tick positions. Defaults to
None.yticks -- y-axis tick positions. Defaults to
None.xticklabels -- x-axis tick labels. Defaults to
None.yticklabels -- y-axis tick labels.
xaxis -- If
True, display the x-axis.yaxis -- If
True, display the y-axis.xname -- Deprecated keyword.
yname -- Deprecated keyword.
- Returns:
None.