chemicalc.plot¶
-
chemicalc.plot.
plot_gradients
(star: chemicalc.reference_spectra.ReferenceSpectra, inst_name: str, labels: List[str], panel_height: float = 3, panel_width: float = 8, inset_ylabel: bool = False, inset_ylabel_xoffset: float = 0, inset_ylabel_yoffset: float = 0, xlim: Optional[Tuple[float, float]] = None, ylim: Optional[Tuple[float, float]] = - 0.11, 0.05, ylim_spec: Tuple[float, float] = 0.35, 1.15, yticks: Optional[List[float]] = None, yticks_spec: Optional[List[float]] = None, xtick_size: float = 18, ytick_size: float = 18, xlabel_size: float = 26, ylabel_size: float = 26, ylabel_pad: float = 10, include_spec: bool = True) → matplotlib.pyplot.figure¶ Plot gradients of a spectrum with respect to its stellar labels.
- Parameters
star (ReferenceSpectra) – Reference star object
inst_name (str) – Instrument name
labels (List[str]) – List of labels
panel_height (float) – Height of each subplot
panel_width (float) – Width of figure
inset_ylabel (bool) – Include label as inset annotation instead of in y-axis (better for large #s of labels)
inset_ylabel_xoffset (float) – Relative x position of label annotation
inset_ylabel_yoffset (float) – Relative y position of label annotation
xlim (Optional[Tuple[float,float]]) – Bounds on the x-axis
ylim (Optional[Tuple[float,float]]) – Bounds on the y-axis (for gradients)
ylim_spec (Tuple[float,float]) – Bounds on the y-axis (for the spetrum if included)
yticks (Optional[List[float]]) – Manual y-axis ticks (for gradients)
yticks_spec (Optional[List[float]]) – Manual y-axis ticks (for the spetrum if included)
xtick_size (float) – Fontsize of x-axis tick labels
ytick_size (float) – Fontsize of y-axis tick labels
xlabel_size (float) – Fontsize of x-axis labels
ylabel_size (float) – Fontsize of y-axis labels
ylabel_pad (float) – Pad between placeholder y-axis label and y-axis when using inset_ylabel
include_spec (bool) – Include spectrum in top panel
- Return plt.figure
Matplotlib figure
-
chemicalc.plot.
plot_crlb
(crlb_list: Union[pandas.core.frame.DataFrame, List[pandas.core.frame.DataFrame]], cutoff: Optional[float] = None, labels: Union[str, List[str]] = None, label_loc: Tuple[float, float] = 0.98, 0.95, panel_height: float = 3, panel_width: float = 8, cutoff_label_xoffset: float = 3, cutoff_label_yoffset: float = 0.05, ylim: Optional[Tuple[float, float]] = 0.009, 1.7, yticks: Optional[List[float]] = None, ytick_ndecimal: int = 2, legend_ncol: int = 1, legend_loc: str = 'lower right', reverse_legend: bool = False, color_palette: str = 'plasma') → matplotlib.pyplot.figure¶ Plots standard presentation of CRLBs
- Parameters
crlb_list (Union[pd.DataFrame,List[pd.DataFrame]]) – CRLB dataframe or list of CRLB dataframes
cutoff (Optional[float]) – Cutoff precision for abundances
labels (Union[str,List[str]]) – List of additional text to include in each panel. Must be same length as the number of CRLB dataframes
label_loc (Tuple[float,float]) – Location of additional text box
panel_height (float) – Height of each subplot
panel_width (float) – Width of each subplot
cutoff_label_xoffset (float) – Relative x position of cutoff label (increases to the left)
cutoff_label_yoffset (float) – Relative y position of cutoff label
ylim (Optional[Tuple[float,float]]) – Bound on y-axis
yticks (Optional[List[float]]) – Manual y-axis ticks. Helpful when log-spacing yields only one tick on the y-axis.
ytick_ndecimal (int) – Number of decimal places to include in y-axis ticks.
legend_ncol (int) – Number of legend columns
legend_loc (str) – Location of legend (standard matplotlib inputs)
reverse_legend (bool) – Reverse order of legend items
color_palette (str) – Color palette of lines and markers (standard matplotlib selection)
- Return plt.figure
Matplotlib figure
-
chemicalc.plot.
overplot_crlb
(crlb_list: List[pandas.core.frame.DataFrame], names: List[str], cutoff: Optional[float] = None, labels: Union[str, List[str]] = None, label_loc: Tuple[float, float] = 0.98, 0.95, panel_height: float = 3, panel_width: float = 8, cutoff_label_xoffset: float = 3, cutoff_label_yoffset: float = 0.05, ylim: Optional[Tuple[float, float]] = 0.009, 1.7, yticks: Optional[List[float]] = None, legend_ncol: int = 1, legend_loc: str = 'lower right', reverse_legend: bool = False, legend2_ncol: int = 1, legend2_loc: Tuple[float, float] = 1, 0.425, reverse_legend2: bool = False, color_palette: str = 'plasma') → matplotlib.pyplot.figure¶ Overplots two groups of CRLBs using different line styles and marker shapes
- Parameters
crlb_list (List[pd.DataFrame]) – List of CRLB dataframes
names (List[str]) – Labels to show in second legend
cutoff (Optional[float]) – Cutoff precision for abundances
labels (Union[str,List[str]]) – List of additional text to include in each panel
label_loc (Tuple[float,float]) – Location of additional text box
panel_height (float) – Height of each subplot
panel_width (float) – Width of each subplot
cutoff_label_xoffset (float) – Relative x position of cutoff label (increases to the left)
cutoff_label_yoffset (float) – Relative y position of cutoff label
ylim (Optional[Tuple[float,float]]) – Bound on y-axis
yticks (Optional[List[float]]) – Manual y-axis ticks
legend_ncol (int) – Number of legend columns
legend_loc (str) – Location of legend (standard matplotlib inputs)
reverse_legend (bool) – Reverse order of legend items
legend2_ncol (int) – Number of legend columns for second legend
float] legend2_loc (Tuple[float,) – Location of legend for second legend (axis coords)
reverse_legend2 (bool) – Reverse order of legend items for second legend
color_palette (str) – Color palette of lines and markers
- Return plt.figure
Matplotlib figure
-
chemicalc.plot.
gridplot_crlb
(crlb: pandas.core.frame.DataFrame, xlabel: str, figsize: Tuple[float, float] = 8, 9, label_fontsize: float = 20, tick_fontsize: float = 10, xtick_rotation: float = - 70, color_palette: str = 'plasma') → matplotlib.pyplot.figure¶ Plots grid representation of the CRLBs for many instrumental specifications.
- Parameters
crlb (pd.DataFrame) – CRLB DataFrame
xlabel (str) – X-axis Label
figsize (Tuple[float,float]) – X- and y-dimensions of figure
label_fontsize (float) – Fontsize of x- and y-axis labels
tick_fontsize (float) – Fontsize of x- and y-axis tick labels
xtick_rotation (float) – Rotation of x-axis tick labels
color_palette (str) – Color palette of figure
- Return plt.figure
Matplotlib figure