Recording user data for heatmap with JavaScript

Heatmap analytics turns out to be WAY more complicated than just capturing the cursor coordinates. Some websites are right-aligned, some are left-aligned, some are 100%-width, some are fixed-width-“centered”… A page element can be positioned absolutely or relatively, floated etc. Oh, and there’s also different screen resolutions and even multi-monitor configurations. Here’s how it works in … Read more

One colorbar for seaborn heatmaps in subplot

The cbar parameter controls whether a colorbar should be added, and the cbar_ax parameter can optionally specify the axes where the colorbar should go. So, you could do: import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np df = pd.DataFrame(np.random.random((10,10,))) fig, axn = plt.subplots(2, 2, sharex=True, sharey=True) cbar_ax … Read more

Seaborn Heatmap with logarithmic-scale colorbar

If you have a current install of seaborn, norm=LogNorm() in the call to heatmap works now. (Pointed out in the comments — thank you.) Adding this to one of the seaborn examples: import numpy as np import seaborn as sns; sns.set_theme(style=”white”) import matplotlib.pyplot as plt from matplotlib.colors import LogNorm, Normalize from matplotlib.ticker import MaxNLocator flights … Read more

How to add a label to Seaborn Heatmap color bar?

You could set it afterwards after collecting it from an ax, or simply pass a label in cbar_kws like so. import seaborn as sns import pandas as pd data = pd.DataFrame({‘x’:(1,2,3,4),’y’:(1,2,3,4),’z’:(14,15,23,2)}) sns.heatmap(data.pivot_table(index=’y’, columns=”x”, values=”z”), cbar_kws={‘label’: ‘colorbar title’}) It is worth noting that cbar_kws can be handy for setting other attributes on the colorbar such as … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)