- Catalog.plot(projection='global', resolution='l', continent_fill_color='0.9', water_fill_color='1.0', label='magnitude', color='depth', colormap=None, show=True, outfile=None, method=None, fig=None, title=None, **kwargs)
Creates preview map of all events in current Catalog object.
projection (str, optional) –
The map projection. Currently supported are:
"global"(Will plot the whole world.)
"ortho"(Will center around the mean lat/long.)
"local"(Will plot around local events)
Defaults to “global”
resolution (str, optional) –
Resolution of the boundary database to use. Possible values are:
continent_fill_color (valid matplotlib color, optional) – Color of the continents. Defaults to
"0.9"which is a light gray.
water_fill_color (valid matplotlib color, optional) – Color of all water bodies. Defaults to
label (str, optional) –
Events will be labelled based on the chosen property. Possible values are:
color (str, optional) –
The events will be color-coded based on the chosen property. Possible values are:
colormap (str, valid matplotlib colormap, optional) – The colormap for color-coding the events. The event with the smallest property will have the color of one end of the colormap and the event with the biggest property the color of the other end with all other events in between. Defaults to None which will use the default colormap for the date encoding and a colormap going from green over yellow to red for the depth encoding.
show (bool) – Whether to show the figure after plotting or not. Can be used to do further customization of the plot before showing it. Has no effect if outfile is specified.
outfile (str) – Output file path to directly save the resulting image (e.g.
"/tmp/image.png"). Overrides the
showoption, image will not be displayed interactively. The given path/filename is also used to automatically determine the output format. Supported file formats depend on your matplotlib backend. Most backends support png, pdf, ps, eps and svg. Defaults to
None. The figure is closed after saving it to file.
method (str) –
Method to use for plotting. Possible values are:
'cartopy'to use the Cartopy library
Noneto pick the best available library
matplotlib.axes.Axes)) – Figure instance to reuse, returned from a previous inventory/catalog plot call with method=cartopy. If a previous cartopy plot is reused, any kwargs regarding the cartopy plot setup will be ignored (i.e. projection, resolution, continent_fill_color, water_fill_color). Note that multiple plots using colorbars likely are problematic, but e.g. one station plot (without colorbar) and one event plot (with colorbar) together should work well. If an
Axesis supplied, the given axes is used to plot into and no colorbar will be produced.
title (str) – Title above plot. If left
None, an automatic title will be generated. Set to
""for no title.
Figure instance with the plot.
Mollweide projection for global overview:
>>> from obspy import read_events >>> cat = read_events() >>> cat.plot()
Local (Albers equal area) projection:
Combining a station and event plot:
>>> from obspy import read_inventory, read_events >>> inv = read_inventory() >>> cat = read_events() >>> fig = inv.plot(show=False) >>> cat.plot(fig=fig)