csep.plots.plot_magnitude_versus_time
- csep.plots.plot_magnitude_versus_time(catalog, color='steelblue', size=4, max_size=300, power=4, alpha=0.5, reset_times=False, ax=None, show=False, **kwargs)[source]
Scatter plot of the catalog magnitudes and origin times. The size of each event is scaled exponentially by its magnitude using the parameters
size,max_sizeandpower.Usage Tutorials
- Parameters:
catalog (CSEPCatalog) – Catalog of seismic events to be plotted.
color (str, optional) – Color of the scatter plot. Defaults to ‘steelblue’.
size (int, optional) – Marker size for the event with the minimum magnitude. Defaults to 4.
max_size (int, optional) – Marker size for the event with the maximum magnitude. Defaults to 300.
power (int, optional) – Power scaling of the scatter sizing. Defaults to 4.
alpha (float, optional) – Transparency level for the scatter points. Defaults to 0.5.
reset_times (bool, optional) – If True, x-axis shows time in days since first event. Defaults to False.
ax (matplotlib.axes.Axes, optional) – Axis object on which to plot. If not provided, a new figure and axis are created. Defaults to None.
show (bool, optional) – Whether to display the plot. Defaults to False.
**kwargs –
Additional keyword arguments to customize the plot:
figsize (tuple): The size of the figure.
title (str): Plot title. Defaults to None.
title_fontsize (int): Font size for the plot title.
xlabel (str): Label for the X-axis. Defaults to ‘Datetime’.
xlabel_fontsize (int): Font size for the X-axis label.
ylabel (str): Label for the Y-axis. Defaults to ‘Magnitude’.
ylabel_fontsize (int): Font size for the Y-axis label.
datetime_locator (matplotlib.dates.Locator): Locator for the X-axis datetime ticks.
datetime_formatter (str or matplotlib.dates.Formatter): Formatter for the datetime axis. Defaults to ‘%Y-%m-%d’.
grid (bool): Whether to show grid lines. Defaults to True.
tight_layout (bool): Whether to use a tight layout for the figure. Defaults to True.
- Returns:
The Matplotlib axes object with the plotted data.
- Return type:
Changed in version 0.8.0: The plot_args dictionary is only partially supported and will be removed in v1.0.0
Added in version 0.8.0: Added parameters to customize magnitude sizing. Show datetime when reset_times is False.