plot_xy (pyleoclim.utils.plotting.plot_xy)
- pyleoclim.utils.plotting.plot_xy(x, y, figsize=None, xlabel=None, ylabel=None, title=None, xlim=None, ylim=None, savefig_settings=None, ax=None, legend=True, plot_kwargs=None, lgd_kwargs=None, mute=False, invert_xaxis=False)[source]
Plot a timeseries
- Parameters
x (array) – The time axis for the timeseries
y (array) – The values of the timeseries
figsize (list) – a list of two integers indicating the figure size
xlabel (str) – label for x-axis
ylabel (str) – label for y-axis
title (str) – the title for the figure
xlim (list) – set the limits of the x axis
ylim (list) – set the limits of the y axis
ax (pyplot.axis) – the pyplot.axis object
legend (bool) – plot legend or not
lgd_kwargs (dict) – the keyword arguments for ax.legend()
plot_kwargs (dict) – the keyword arguments for ax.plot()
mute (bool) –
if True, the plot will not show; recommend to turn on when more modifications are going to be made on ax
(going to be deprecated)
savefig_settings (dict) –
the dictionary of arguments for plt.savefig(); some notes below: - “path” must be specified; it can be any existed or non-existed path,
with or without a suffix; if the suffix is not given in “path”, it will follow “format”
”format” can be one of {“pdf”, “eps”, “png”, “ps”}
invert_xaxis (bool, optional) – if True, the x-axis of the plot will be inverted
- Returns
ax
- Return type
the pyplot.axis object
See also
pyleoclim.utils.plotting.set_style
set different styles for the figures. Should be set before invoking the plotting functions
pyleoclim.utils.plotting.savefig
save figures
pyleoclim.utils.plotting.showfig
equivalent to plt.show(). Platform-dependent