Quantcast
Channel: Seaborn Heatmap Colorbar Label as Percentage - Stack Overflow
Browsing latest articles
Browse All 5 View Live

Answer by Joe Heffer for Seaborn Heatmap Colorbar Label as Percentage

You should get the colour bar object and then get the relevant axis object:import matplotlib.pyplot as pltfrom matplotlib.ticker import PercentFormatterfig, ax = plt.subplots()sns.heatmap(df, ax=ax,...

View Article



Answer by Alexandre for Seaborn Heatmap Colorbar Label as Percentage

Well, I had a similar problem and figured out how to properly set a formatter. Your example would become something like:import numpy as np; np.random.seed(0)import seaborn as sns; sns.set()uniform_data...

View Article

Image may be NSFW.
Clik here to view.

Answer by Stefaan for Seaborn Heatmap Colorbar Label as Percentage

iterating on the solution of @mwaskom, without creating the colorbar yourself:import numpy as npimport seaborn as snsdata = np.random.rand(8, 12)ax = sns.heatmap(data, vmin=0, vmax=1)cbar =...

View Article

Image may be NSFW.
Clik here to view.

Answer by mwaskom for Seaborn Heatmap Colorbar Label as Percentage

You need to be able to access the colorbar object. It might be buried in the figure object somewhere, but I couldn't find it, so the easy thing to do is just to make it yourself:import numpy as np;...

View Article

Seaborn Heatmap Colorbar Label as Percentage

Given this heat map:import numpy as np; np.random.seed(0)import seaborn as sns; sns.set()uniform_data = np.random.rand(10, 12)ax = sns.heatmap(uniform_data)How would I go about making the color bar...

View Article

Browsing latest articles
Browse All 5 View Live




Latest Images