pyValEIA.plots.utils ==================== .. py:module:: pyValEIA.plots.utils .. autoapi-nested-parse:: Utility functions for formatting or creating plots. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: pyValEIA.plots.utils.format_latitude_labels pyValEIA.plots.utils.latitude_formatter pyValEIA.plots.utils.longitude_formatter pyValEIA.plots.utils.format_longitude_labels pyValEIA.plots.utils.make_legend pyValEIA.plots.utils.daynight_label Module Contents --------------- .. py:function:: format_latitude_labels(ax, xy='x') Format the latitude axis labels with degree symbols and N/S suffixes. :Parameters: **ax** : matplotlib.axes.Axes The Matplotlib axes object to format **xy** : str Specifies whether the x or y axis is being formatted (default='x') .. !! processed by numpydoc !! .. py:function:: latitude_formatter(latitude, pos) Format latitude ticks to include degrees and hemisphere, removing signs. :Parameters: **latitude** : float Latitude tick value in degrees from -90 to 90. **pos** : float Position, not used but required for use as FuncFormatter :Returns: **lat_str** : str Formatted latitude string .. rubric:: Notes Designed for use within mpl.ticker.FuncFormatter .. !! processed by numpydoc !! .. py:function:: longitude_formatter(longitude, pos) Format longitude ticks to include degrees and hemisphere, removing signs. :Parameters: **longitude** : float Longitude tick value in degrees from -180 to 360. **pos** : float Position, not used but required for use as FuncFormatter :Returns: **lon_str** : str Formatted latitude string .. rubric:: Notes Designed for use within mpl.ticker.FuncFormatter .. !! processed by numpydoc !! .. py:function:: format_longitude_labels(ax, xy='x') Format the longitude axis labels with degree symbols and E/W suffixes. :Parameters: **ax** : matplotlib.axes.Axes The Matplotlib axes object **xy** : str kwarg 'x', 'y', or 'z' depending on which axis you want to have the degree symbol with E/W formatting (default='x') :Raises: ValueError If unknown axis supplied. .. !! processed by numpydoc !! .. py:function:: make_legend(leg_ax, leg_labs, leg_cols, leg_styles, modes, **kwargs) Create a custom legend on a given axis. :Parameters: **leg_ax** : matplotlib axis Axis to place the legend on. **leg_labs** : list of str Labels for the legend entries. **leg_cols** : list of str Colors for the legend entries. **leg_styles** : list of str Marker styles (if scatter) or line styles (if line). **modes** : list of str Type of legend entry for each label. Options: "line", "scatter", "shading", "line+shading". **kwargs** : dict Additional keyword arguments passed to ax.legend(). .. !! processed by numpydoc !! .. py:function:: daynight_label(model, LT_range=None) Generate Label for local time day and night. :Parameters: **model** : pd.DataFrame model dataframe build by states_report_swarm **LT_range** : list-like or NoneType Range of day night local time, or None for default of [7, 19] (default=None) :Returns: **lab_day** : string legend label for daytime **lab_night** : string legend label for nighttime .. !! processed by numpydoc !!