swarmplot

How to change the position of a single swarm group

一世执手 提交于 2021-01-28 06:58:39
问题 I am plotting a grouped bar plot on which I overlay a swarmplot and errorbars. One of the groups only have one bar, which I want to appear (with the swarm and the errorbar) in the middle of the location allocated to this group of bars. I managed to move the bar and the errorbar, but not sure how to move the swarm. Here is the code I have: import seaborn as sns import matplotlib.pyplot as plt mypallet = sns.color_palette([(190/256,7/256, 18/256),(127/256, 127/256, 127/256)]) import itertools

Plot another point on top of swarmplot

▼魔方 西西 提交于 2020-04-16 02:53:05
问题 I want to plot a "highlighted" point on top of swarmplot like this The swarmplot don't have the y-axis, so I have no idea how to plot that point. import seaborn as sns sns.set(style="whitegrid") tips = sns.load_dataset("tips") ax = sns.swarmplot(x=tips["total_bill"]) 回答1: This approach is predicated on knowing the index of the data point you wish to highlight, but it should work - although if you have multiple swarmplots on a single Axes instance it will become slightly more complex. import