Base Plot Configuration Pool#

This page documents utopya’s base plot configuration pool which is used for aggregating a plot configuration using multiple inheritance.

The entries below are sorted by segments and are using dantro’s naming convention. Some sections are still empty, meaning that utopya does not define new entries there.

Note

Important: All entries here are in addition to the dantro base plots configuration pool.

More precisely, the utopya base plots config pool requires the dantro base plots config, as it inherits some entries using based_on.

Hint

To quickly search for individual entries, the search functionality of your browser (Cmd + F) may be very helpful. Note that some entries (like those of the YAML anchors) may only be found if the complete file reference is expanded.


.defaults: default entries#

# This section defines defaults that are (meant to be) used in all plots.
# These find their way into the plot configuration via the `.creator` configs.

# .. Aggregated defaults ......................................................
.defaults:
  based_on:
    - .defaults  # dantro .defaults
    - .defaults.style
    - .defaults.file_ext


# .. Individual defaults ......................................................
.defaults.style:
  based_on: .defaults.style

.defaults.file_ext:
  file_ext: pdf

.creator: selecting a plot creator#

More information: Plot Creators

.creator.base:
  based_on:
    - .creator.base
    - .defaults

.creator.pyplot:
  based_on:
    - .creator.pyplot
    - .defaults

.creator.universe:
  based_on:
    - .creator.universe
    - .defaults

.creator.multiverse:
  based_on:
    - .creator.multiverse
    - .defaults

.plot: selecting a plot function#

More information:

# -- Cellular Automaton plots -------------------------------------------------
# A plot function specialized for Cellular Automata snapshots or animations.
# Unlike its predecessor, it supports the data transformation framework.
.plot.ca:
  based_on:
    - .animation.defaults

  module: !add [*utopya_plots, .ca]
  plot_func: caplot

  compute_only: all

  default_imshow_kwargs:
    interpolation: 'none'

  suptitle_fstr: "{}: {:>5}"
  suptitle_kwargs:
    fontsize: x-large
    fontfamily: monospace

  style:
    figure.constrained_layout.use: true

.plot.ca.snapshot:
  based_on:
    # - .plot.ca  # do not inherit again, would cause overwriting downstream
    - .animation.disabled

  frames_isel: -1



# -- Seaborn plots ------------------------------------------------------------
.plot.snsplot:
  module: !add [*utopya_plots, .snsplot]
  plot_func: snsplot



# -- Graph plots --------------------------------------------------------------
.plot.graph:
  module: !add [*utopya_plots, .graph]
  plot_func: draw_graph

  graph_drawing:
    nodes:
      colorbar:
        fraction: 0.05
        pad: 0.02
    edges:
      colorbar:
        fraction: 0.05
        pad: 0.02



# -- Distributions ------------------------------------------------------------
.plot.histogram:
  module: !add [*utopya_plots, .distributions]
  plot_func: histogram




# -- A (non-faceting) time series plot ----------------------------------------
# NOTE Use .plot.facet_grid.line for a more general implementation
.plot.time_series:
  module: !add [*utopya_plots, .time_series]
  plot_func: time_series



# -- Bifurcation diagrams -----------------------------------------------------
# NOTE This is not a DAG-based plot
.plot.bifurcation_diagram:
  based_on:
    - .creator.multiverse

  module: !add [*utopya_plots, .attractor]
  plot_func: bifurcation_diagram

  analysis_kwargs: ~

  # Disable grid
  style:
    axes.grid: false




# -- DEPRECATED PLOTS ---------------------------------------------------------
# NOTE This is the legacy plot function, will be removed; use .plot.ca instead!
.ca.state:
  based_on:
    - .creator.universe  # does not work with anything else
    - .animation.disabled

  module: !add [*utopya_plots, .ca]
  plot_func: state

  file_ext: pdf

  default_imshow_kwargs:
    interpolation: 'none'

  # Can use constrained layout, because axis labels don't change
  style:
    figure.constrained_layout.use: true



# .. .ca.state specializations for different animation writers ................
.ca.state.anim_frames:
  based_on:
    - .ca.state
    - .animation.frames

  time_idx: 0  # ignored in animations, but required

.ca.state.anim_ffmpeg:
  based_on:
    - .ca.state
    - .animation.ffmpeg

  time_idx: 0  # ignored in animations, but required

.style: choosing plot style#

More information: Adjusting a Plot’s Style

# More information:
#   https://matplotlib.org/gallery/style_sheets/style_sheets_reference.html
#   https://matplotlib.org/stable/tutorials/introductory/customizing.html

.hlpr: invoking individual plot helper functions#

More information: The PlotHelper


.animation: controlling animation#

More information: Animations

.animation.defaults:
  based_on:
    - .animation.defaults  # from dantro
    - .animation.high_dpi  # from dantro


# Aliases (with slightly different names) for setting the animation writer
# and enabling animation. Unlike those in dantro, these *include* the defaults.
.animation.ffmpeg:
  based_on:
    - .animation.defaults
    - .animation.enabled
    - .animation.use_ffmpeg

.animation.frames:
  based_on:
    - .animation.defaults
    - .animation.enabled
    - .animation.use_frames

.dag: configuring the DAG framework#

More information:

# -- Options ------------------------------------------------------------------
# .. Aggregated DAG default options ...........................................
.dag.defaults:
  based_on: .dag.defaults



# -- Visualization ------------------------------------------------------------
# Parameters controlling DAG visualization
.dag.vis.defaults:
  based_on: .dag.vis.defaults



# -- Definitions --------------------------------------------------------------
# The entries below set certain tags using the `dag_options.define` argument.
# This should not be confused with the .dag.meta_ops defined below.

.dag.define.defaults:
  based_on: .dag.define.defaults

.dag.meta_ops: meta operations#

The following entries can be included into a plot configuration to make pre-defined meta-operations available for the data transformation framework.

# The following entries can be included into a plot configuration to make
# certain meta-operations available for the data transformation framework.

Complete File Reference#

# This file provides the base plot configuration pool for utopya
#
# It assumes that the dantro base plot configuration pool is available:
#     https://dantro.readthedocs.io/en/latest/plotting/base_plots.html
#
# Many base plot config entries here inherit from existing dantro base plot
# config entries of the same name. This is to allow overwriting of some of the
# default values, e.g. for the `.creator.<name>` entries.
#
# For the plot functions defined here in utopya, additional entries of the form
# `.plot.<name>` are added.
#
# There is room to add more configurations here; they should be sorted into the
# respective sections and adhere to the naming conventions (see dantro docs).
---
# YAML variable definitions that are used below to avoid repetition
_:
  variables:
    dantro_plots:       &dantro_plots           dantro.plot.funcs
    plots_module:       &utopya_plots           utopya.eval.plots

  aesthetics:
    hvline: &style_hvline
      linestyle: solid
      color: grey
      alpha: .4
      linewidth: 2.
      zorder: -42

    # Defaults for a colorbar
    # https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.colorbar.html
    cbar_kwargs: &cbar_kwargs
      shrink: .65
      aspect: 30
      orientation: vertical
      pad: 0.05



# =============================================================================
#  ╔╦╗╔═╗╔═╗╔═╗╦ ╦╦ ╔╦╗╔═╗
#   ║║║╣ ╠╣ ╠═╣║ ║║  ║ ╚═╗
#  ═╩╝╚═╝╚  ╩ ╩╚═╝╩═╝╩ ╚═╝
# =============================================================================
# start: .defaults
# This section defines defaults that are (meant to be) used in all plots.
# These find their way into the plot configuration via the `.creator` configs.

# .. Aggregated defaults ......................................................
.defaults:
  based_on:
    - .defaults  # dantro .defaults
    - .defaults.style
    - .defaults.file_ext


# .. Individual defaults ......................................................
.defaults.style:
  based_on: .defaults.style

.defaults.file_ext:
  file_ext: pdf







# =============================================================================
#  ╔═╗╦  ╔═╗╔╦╗  ╔═╗╦═╗╔═╗╔═╗╔╦╗╔═╗╦═╗╔═╗
#  ╠═╝║  ║ ║ ║   ║  ╠╦╝║╣ ╠═╣ ║ ║ ║╠╦╝╚═╗
#  ╩  ╩═╝╚═╝ ╩   ╚═╝╩╚═╚═╝╩ ╩ ╩ ╚═╝╩╚═╚═╝
# =============================================================================
# start: .creator
.creator.base:
  based_on:
    - .creator.base
    - .defaults

.creator.pyplot:
  based_on:
    - .creator.pyplot
    - .defaults

.creator.universe:
  based_on:
    - .creator.universe
    - .defaults

.creator.multiverse:
  based_on:
    - .creator.multiverse
    - .defaults





# =============================================================================
#  ╔═╗╦  ╔═╗╔╦╗  ╔═╗╦ ╦╔╗╔╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
#  ╠═╝║  ║ ║ ║   ╠╣ ║ ║║║║║   ║ ║║ ║║║║╚═╗
#  ╩  ╩═╝╚═╝ ╩   ╚  ╚═╝╝╚╝╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
# =============================================================================
# start: .plot
# -- Cellular Automaton plots -------------------------------------------------
# A plot function specialized for Cellular Automata snapshots or animations.
# Unlike its predecessor, it supports the data transformation framework.
.plot.ca:
  based_on:
    - .animation.defaults

  module: !add [*utopya_plots, .ca]
  plot_func: caplot

  compute_only: all

  default_imshow_kwargs:
    interpolation: 'none'

  suptitle_fstr: "{}: {:>5}"
  suptitle_kwargs:
    fontsize: x-large
    fontfamily: monospace

  style:
    figure.constrained_layout.use: true

.plot.ca.snapshot:
  based_on:
    # - .plot.ca  # do not inherit again, would cause overwriting downstream
    - .animation.disabled

  frames_isel: -1



# -- Seaborn plots ------------------------------------------------------------
.plot.snsplot:
  module: !add [*utopya_plots, .snsplot]
  plot_func: snsplot



# -- Graph plots --------------------------------------------------------------
.plot.graph:
  module: !add [*utopya_plots, .graph]
  plot_func: draw_graph

  graph_drawing:
    nodes:
      colorbar:
        fraction: 0.05
        pad: 0.02
    edges:
      colorbar:
        fraction: 0.05
        pad: 0.02



# -- Distributions ------------------------------------------------------------
.plot.histogram:
  module: !add [*utopya_plots, .distributions]
  plot_func: histogram




# -- A (non-faceting) time series plot ----------------------------------------
# NOTE Use .plot.facet_grid.line for a more general implementation
.plot.time_series:
  module: !add [*utopya_plots, .time_series]
  plot_func: time_series



# -- Bifurcation diagrams -----------------------------------------------------
# NOTE This is not a DAG-based plot
.plot.bifurcation_diagram:
  based_on:
    - .creator.multiverse

  module: !add [*utopya_plots, .attractor]
  plot_func: bifurcation_diagram

  analysis_kwargs: ~

  # Disable grid
  style:
    axes.grid: false




# -- DEPRECATED PLOTS ---------------------------------------------------------
# NOTE This is the legacy plot function, will be removed; use .plot.ca instead!
.ca.state:
  based_on:
    - .creator.universe  # does not work with anything else
    - .animation.disabled

  module: !add [*utopya_plots, .ca]
  plot_func: state

  file_ext: pdf

  default_imshow_kwargs:
    interpolation: 'none'

  # Can use constrained layout, because axis labels don't change
  style:
    figure.constrained_layout.use: true



# .. .ca.state specializations for different animation writers ................
.ca.state.anim_frames:
  based_on:
    - .ca.state
    - .animation.frames

  time_idx: 0  # ignored in animations, but required

.ca.state.anim_ffmpeg:
  based_on:
    - .ca.state
    - .animation.ffmpeg

  time_idx: 0  # ignored in animations, but required







# =============================================================================
#  ╔═╗╔╦╗╦ ╦╦  ╔═╗
#  ╚═╗ ║ ╚╦╝║  ║╣
#  ╚═╝ ╩  ╩ ╩═╝╚═╝
# =============================================================================
# start: .style
# More information:
#   https://matplotlib.org/gallery/style_sheets/style_sheets_reference.html
#   https://matplotlib.org/stable/tutorials/introductory/customizing.html






# =============================================================================
#  ╔═╗╦  ╔═╗╔╦╗  ╦ ╦╔═╗╦  ╔═╗╔═╗╦═╗╔═╗
#  ╠═╝║  ║ ║ ║   ╠═╣║╣ ║  ╠═╝║╣ ╠╦╝╚═╗
#  ╩  ╩═╝╚═╝ ╩   ╩ ╩╚═╝╩═╝╩  ╚═╝╩╚═╚═╝
# =============================================================================
# start: .hlpr






# =============================================================================
#  ╔═╗╔╗╔╦╔╦╗╔═╗╔╦╗╦╔═╗╔╗╔
#  ╠═╣║║║║║║║╠═╣ ║ ║║ ║║║║
#  ╩ ╩╝╚╝╩╩ ╩╩ ╩ ╩ ╩╚═╝╝╚╝
# =============================================================================
# start: .animation

.animation.defaults:
  based_on:
    - .animation.defaults  # from dantro
    - .animation.high_dpi  # from dantro


# Aliases (with slightly different names) for setting the animation writer
# and enabling animation. Unlike those in dantro, these *include* the defaults.
.animation.ffmpeg:
  based_on:
    - .animation.defaults
    - .animation.enabled
    - .animation.use_ffmpeg

.animation.frames:
  based_on:
    - .animation.defaults
    - .animation.enabled
    - .animation.use_frames






# =============================================================================
#  ╔╦╗╔═╗╔═╗  ╔═╗╦═╗╔═╗╔╦╗╔═╗╦ ╦╔═╗╦═╗╦╔═
#   ║║╠═╣║ ╦  ╠╣ ╠╦╝╠═╣║║║║╣ ║║║║ ║╠╦╝╠╩╗
#  ═╩╝╩ ╩╚═╝  ╚  ╩╚═╩ ╩╩ ╩╚═╝╚╩╝╚═╝╩╚═╩ ╩
# =============================================================================
# start: .dag
# -- Options ------------------------------------------------------------------
# .. Aggregated DAG default options ...........................................
.dag.defaults:
  based_on: .dag.defaults



# -- Visualization ------------------------------------------------------------
# Parameters controlling DAG visualization
.dag.vis.defaults:
  based_on: .dag.vis.defaults



# -- Definitions --------------------------------------------------------------
# The entries below set certain tags using the `dag_options.define` argument.
# This should not be confused with the .dag.meta_ops defined below.

.dag.define.defaults:
  based_on: .dag.define.defaults








# =============================================================================
#  ╔╦╗╔═╗╔═╗  ╔╦╗╔═╗╔╦╗╔═╗  ╔═╗╔═╗╔═╗╦═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
#   ║║╠═╣║ ╦  ║║║║╣  ║ ╠═╣  ║ ║╠═╝║╣ ╠╦╝╠═╣ ║ ║║ ║║║║╚═╗
#  ═╩╝╩ ╩╚═╝  ╩ ╩╚═╝ ╩ ╩ ╩  ╚═╝╩  ╚═╝╩╚═╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
# =============================================================================
# start: .dag.meta_ops
# The following entries can be included into a plot configuration to make
# certain meta-operations available for the data transformation framework.





# =============================================================================