Graphical Summaries

If you have obtained future state probabilites for an individual using survivorship_vector(), you can obtain a nice stacked area plot of state probabilities using survivorship_graph(). The aesthetic value of these plots is heavily dependent on your choice of colours, so you may want to play around with that a bit.

METER.plots.survivorship_graph(survdf, states, colors, order='default')

Stacked area chart of state probabilities for an individual.

Parameters
  • survdf (pandas dataframe) – a dataframe containing the given probabilities of being in each state at each age for some initial condition. This is precisely the output of survivorship_vector().

  • states (list) – a list of the states in the model

  • colors (list) – a list of colors accepted by matplotlib (as strings) that matches the number of states

  • order (list) – the order you want the states to be from top to bottom in the graph. The default is reverse order, which is fairly visually appealing. If an input is passed it should be something like [0,1,2,3] with 0 representing the first state, 1 the second state, etc.

Returns

a graph of state proportions for some initial conditions

Return type

plot