pysep.utils.plot ================ .. py:module:: pysep.utils.plot .. autoapi-nested-parse:: Pysep plotting utilities Functions --------- .. autoapisummary:: pysep.utils.plot.plot_geometric_spreading pysep.utils.plot.plot_source_receiver_map pysep.utils.plot.set_plot_aesthetic Module Contents --------------- .. py:function:: plot_geometric_spreading(distances, max_amplitudes, geometric_spreading_factor, geometric_k_value, units='km', station_ids=None, include=None, show=False, save='geometric_spreading.png', ymax=None, **kwargs) Plot a scatter plot of peak amplitudes vs distance and a corresponding line representing geometric scatter. Allow ignoring stations by index. .. note:: see recsec.RecordSection._calculate_geometric_spreading() for more information on this function :type distances: list or np.array :param distances: source-receiver distance in units `units` :type max_amplitudes: list or np.array :param max_amplitudes: peak amplitudes, units irrelevant :type units: st :param units: 'km' or 'deg' for kilometers or degrees, respectively. used for the x-axis label only :type geometric_spreading_factor: float :param geometric_spreading_factor: exponent for spreading eq :type geometric_k_value: float :param geometric_k_value: constant scale factor for spreading eq :type station_ids: list or np.array :param station_ids: station ids for optional text labels :type include: list or np.array :param include: indices of stations included in equation, used for colors :type show: bool :param show: show the figure after generation :type save: str :param save: file name to save figure :type ymax: float :param ymax: set the ceiling y limit manually (incase some stations are scaled improperly which would throw off all the scaling). Also cuts off any stations above this limit and plots them differently .. py:function:: plot_source_receiver_map(inv, event, subset=None, save='./station_map.png', projection=None, show=False) Simple utility to plot station and event on a single map with Cartopy :type event: obspy.core.event.Event :param event: event to get location from :type inv: obspy.core.inventory.Inventory :param inv: inventory to get locatiosn from :type subset: list of str :param subset: allow subsetting stations in the Inventory. Station IDs should match the format output by function `obspy.trace.Trace.get_id()`, that is, NN.SSS.LL.CCC (Network, Station, Location, Channel). Location and channel information are not used during subsetting. :type save: str :param save: filename to save station map, defaults: ./station_map.png :type projection: str :param projection: map projection, 'local, 'ortho', 'global' or None. If None, will be determined based on largest src-rcv distance :type show: bool :param show: show the figure in the GUI .. py:function:: set_plot_aesthetic(ax, ytick_fontsize=8.0, xtick_fontsize=12.0, tick_linewidth=1.5, tick_length=5.0, tick_color='k', tick_direction='in', xlabel_fontsize=10.0, ylabel_fontsize=10.0, label_color='k', axis_linewidth=2.0, spine_zorder=8, spine_top=True, spine_bot=True, spine_left=True, spine_right=True, spine_color='k', title_fontsize=10.0, title_color='k', xtick_minor=None, xtick_major=None, ytick_minor=None, ytick_major=None, xgrid_major=True, xgrid_minor=True, ygrid_major=True, ygrid_minor=True, frame_color=None, bg_color='w', **kwargs) Give a nice look to the output figure by creating thick borders on the axis, adjusting fontsize etc. All plot aesthetics should be placed here so it's easiest to find. :type ax: matplotlib.axes._subplots.AxesSubplot :param ax: matplotlib axis figure to set plot aesthetic for :type ytick_fontsize: float :param ytick_fontsize: fontsize for labels next to Y-axis ticks :type xtick_fontsize: float :param xtick_fontsize: fontsize for labels next to X-axis ticks :type tick_linewidth: float :param tick_linewidth: thickness of tick marks for both X and Y axes :type tick_length: float :param tick_length: length of tick marks for both X and Y axes :type tick_direction: str :param tick_direction: 'in' for ticks pointing inwards, 'out' for ticks pointing outwards :type tick_color: str :param tick_color: color of the tick marks and their labels :type xlabel_fontsize: float :param xlabel_fontsize: font size for the X-axis main label (e.g., Time) :type ylabel_fontsize: float :param ylabel_fontsize: font size for the Y-axis main label (e.g., Ampli) :type axis_linewidth: float :param axis_linewidth: line thickness for the borders of the figure :type spine_zorder: int :param spine_zorder: Z order (visibility) of the axis borders (spines) :type spine_top: bool :param spine_top: toggle on/off the top axis border :type spine_bot: bool :param spine_bot: toggle on/off the bottom axis border :type spine_left: bool :param spine_left: toggle on/off the left axis border :type spine_right: bool :param spine_right: toggle on/off the right axis border :type spine_color: str :param spine_color: color of the axis frames/spines :type title_fontsize: float :param title_fontsize: font size of the main title at the top of the figure :type title_color: str :param title_color: color of the main title at the top of the figure :type xtick_minor: float :param xtick_minor: how often minor tick marks are drawn on X axis :type xtick_major: float :param xtick_major: how often major tick marks are drawn on X axis :type ytick_minor: float :param xtick_minor: how often minor tick marks are drawn on Y axis :type ytick_major: float :param ytick_major: how often major tick marks are drawn on Y axis :type xgrid_minor: bool :param xgrid_minor: turn on grid lines for each minor X tick :type xgrid_major: bool :param xgrid_major: turn on grid lines for each major X tick :type ygrid_minor: bool :param ygrid_minor: turn on grid lines for each minor Y tick :type ygrid_major: bool :param ygrid_major: turn on grid lines for each minor Y tick :type frame_color: str :param frame_color: color of the frame around the figure, overwrites `spine_color`, `tick_color`, `label_color`, and `title_color` :type bg_color: str :param bg_color: background color of the figure, defaults to white :rtype: matplotlib.axes._subplots.AxesSubplot :return: input axis with aesthetic changed