2

Using Seaborn's pointplot I have created the following image:

pointplot

I was wondering if I could change the size of each marker to be a unique value.

The image was made by calling

sns.pointplot(x = 'Partying',
              y = 'Province', 
              ci =95,
              data = df, 
              join = False, 
              ax = ax,
              color = pal[2],


              )

I thought maybe passing an array into the scale argument would work, but it didn't.

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Demetri Pananos
  • 6,770
  • 9
  • 42
  • 73

1 Answers1

2

Not through the seaborn API, but it's possible by manipulating the matplotlib objects after plotting — something like:

import seaborn as sns
tips = sns.load_dataset("tips")

ax = sns.pointplot(x="tip", y="day", data=tips, join=False)
points = ax.collections[0]
size = points.get_sizes().item()
new_sizes = [size * 3 if name.get_text() == "Fri" else size for name in ax.get_yticklabels()]
points.set_sizes(new_sizes)

enter image description here

mwaskom
  • 46,693
  • 16
  • 125
  • 127