[Solved] seaborn: decrease the size of the markers

Code:
ax = sns.swarmplot(y="time_taken", x="dtype", data=all_results, color=".25")
Error:
/usr/local/Cellar/jupyterlab/3.3.2/libexec/lib/python3.9/site-packages/seaborn/categorical.py:1296: UserWarning: 35.9% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.
warnings.warn(msg, UserWarning)Fix:
ax = sns.swarmplot(y="time_taken", x="dtype", data=all_results, color=".25", size=3.25)
This seaborn warning appears when a swarm plot cannot place every point without overlap, so some are dropped. It is a sign the markers are too large for the amount of data.
Reducing the marker size with the size parameter, or switching to a strip plot, lets all points show. Both are quick changes to the plotting call.

Comments
Post a Comment