plot-annotations

Plotting percentage in seaborn bar plot

Plotting percentage in seaborn bar plot Question: For a dataframe import pandas as pd df=pd.DataFrame({‘group’:list(“AADABCBCCCD”),’Values’:[1,0,1,0,1,0,0,1,0,1,0]}) I am trying to plot a barplot showing percentage of times A, B, C, D takes zero (or one). I have a round about way which works but I am thinking there has to be more straight forward way tempdf=df.groupby([‘group’,’Values’]).Values.count().unstack().fillna(0) …

Total answers: 4

How to annotate seaborn pairplots

How to annotate seaborn pairplots Question: I have a collection of binned data from which I generate a series of seaborn pairplots. Since all of the bins have the same labels, but not bin names, I need to annotate the pairplots with the bin name ‘n’ below so that I can later associate them with …

Total answers: 2

Matplotlib: Annotate Subplots in a Figure with A, B, C

Matplotlib: Annotate Subplots in a Figure with A, B, C Question: When submitting papers to scientific journals one quite frequently needs to enumerate the different subplots of a figure with A, B, … . This sounds like a very common problem and I was trying to find an elegant way to do that automatically with …

Total answers: 1

How to add text to a surface

How to add text to a surface Question: I created rectangular prism with a parallelogram base using plot_surface. I need to add some text to one of surface. I tried ax.text(3, 0.5, 1, "red", (1, 1, 0), color=’red’), but text is not visible over the surface. import matplotlib.pyplot as plt import numpy as np fig …

Total answers: 2