Skip to content

fomightez/donut_plots_with_subgroups

Repository files navigation

Binder

donut_plots_with_subgroups

Several generalized scripts for making donut plots that include subgroups

Click on launch binder badge above to spin up a sesion where you can make plots.

These scripts/approaches take dataframes or tabular text (tables as text) as input.

If you have data as a table from elsewhere you can convert it/export into tabular text as tab-separated or comma-separated form and that can be used as input by any of the approaches here.


Demonstration notebooks

There are five demo notebooks:
The first notebook that opens in the active session demonstrates a script that makes it easy to make a plot like the following from a dataframe or data table.
Typical input for first two notebooks (only a portion is represented; red annotation added for illustrating terminology):

typical_input_repr

Typical results (two separate images shown):

typical1


typical2

The second notebook shows the underlying code that runs that script and makes a plot like shown in the example from The Python Graph Gallery.
Typical result:

typical_basics

The third notebook shows how to make a plot that includes a summary of the subgroups on the left with a plot with the subgroups on the right.
Typical input (red annotation added for illustrating terminology):

data_for_subgroups

Typical result:

typical_nb3

The fourth notebook shows how to make a plot much like the third notebook produces; however, this script is specialized for binary data for the subgroups, i.e., they can only have two resulting states at most.
Typical input (red annotation added for illustrating terminology):

df_for_binary

Typical result:

typical_nb4

The fifth notebook shows how to use a custom list of colors with the idea that you can finetune the plot for matching a color palette:

Typical result:

typical_nb5


Click on a launch binder badge on this page to spin up a sesion where you can make plots.

Binder


Related

  • gos: (epi)genomic visualization in python looks to create donut-plot like heat maps according to that page (although at the time I was unable to find an example of that type among the gallery that included code)

About

Several generalized scripts for making donut plots that include subgroups using dataframes and text tables as input.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published