Seaborn: How to change line width and mark separately in factorplot?

I understand that scale changes both parameters at the same time, but I want to achieve the effect of a thin line connected between large markers.

I also tried resizing with rc{'lines.linewidth' = 1, 'lines.markersize' = 5} , but in the end it scales both the marker and the line width together, instead of setting them independently. Essentially, markersize not valid for some reason.

Edit: added plot and code to show problem

 import seaborn as sns sns.set(style="whitegrid") paper_rc = {'lines.linewidth': 1, 'lines.markersize': 10} sns.set_context("paper", rc = paper_rc) # Load the example exercise dataset df = sns.load_dataset("exercise") # Draw a pointplot to show pulse as a function of three categorical factors g = sns.factorplot(x="time", y="pulse", hue="kind", col="diet", data=df, palette="YlGnBu_d", size=6, aspect=.75) g.despine(left=True) 

The first two figures below are created with markers 1 and 10, respectively. As shown, they seem to have the same markers. The last digit uses line.linewidth=10 line.markersize=1 , which increases the line width and marker.

Marker Size 1

Marker Size 10

Marker and line size 10

+6
source share
1 answer

you can import seaborn to get a nice layout, and build using matplotlib to get lighter / better customization tools.

with matplotlib you can simply draw 2 plots on one shape, a scatter plot (with an arbitrary marker) and a line plot with an arbitrary line width

hope that helps

0
source

All Articles