Skip to content

Plot hierarchy

Ari Hartikainen edited this page Nov 24, 2019 · 8 revisions

NOTE: This currently WIP

Function structure: function = one axis <-> one function {function1, function2} = one axis <-> select one function (function1, function2) = one axis <-> multiple functions

function_name <- function_combine[{function_select1,function_select2},function_name1,(function_same_ax1, function_same_axis2)]

ArviZ has hierarchical plot-function structure.

Level 1: Atomic plot (1 axis)

The first level functions operates against one axis with one or more variables. Each function then calls backend function to do actual plotting.

These functions include:

  • plot_atomic_kde
  • plot_atomic_hist
  • plot_atomic_dist <- {plot_atomic_kde, plot_atomic_hist}
  • plot_atomic_line
  • plot_atomic_box
  • plot_atomic_rug
  • plot_atomic_text
  • plot_atomic_scatter
  • plot_atomic_autocorr
  • plot_atomic_rank

The common input and default values for these functions are

*arr: one or two {ndarray, str}
source: {xarray.Dataset, pandas.DataFrame,bokeh.ColumnDataSource}; optional
ax: {matplotlib.axis, bokeh.figure}; optional
labels: one or two {str, bokeh.Text}
line_kwargs: {dict}; optional
    line properties
fill_kwargs: {dict}; optional
    area properties
special_kwargs: {dict}; optional
    special plot specific properties
backend: {"matplotlib","bokeh"} 

Atomic plot returns the axis.

Level 2A: multiple parameters, one atomic plot

  • plot_hpd
  • plot_regression
  • plot_pair
  • plot_parallel
  • plot_ess
  • plot_density <- {plot_atomic_kde, plot_atomic_hist}

Level 2B: One or multiple parameters, one or multiple atomic plots

  • plot_rank
  • plot_ppc
  • plot_joint
  • plot_autocorr <- plot_grid[plot_atomic_autocorr]
  • plot_trace <- plot_col[plot_row[plot_atomic_dist,{plot_atomic_line,plot_atomic_rank}]]
  • plot_forest <- plot_grid[plot_grid[{plot_atomic_box,plot_atomic_kde,plot_atomic_violin},plot_atomic_box,plot_atomic_box]]

Level X: Specialized plots (special parameters)

  • plot_compare
  • plot_elpd <- plot_atomic_box
  • plot_energy <- plot_atomic_kde
  • plot_khat
  • plot_loopit
  • plot_posterior <- plot_grid[(plot_atomic_dist,plotatomic_text)]

Level Y: Dashboard / PlotGrid

  • plot_dashboard
  • plot_grid <- plot_row + plot_col
  • plot_row
  • plot_col