How to change linewidth and markersize separately in factorplot
Asked Answered
C

1

20

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

I also tried resizing through rc{'lines.linewidth' = 1, 'lines.markersize' = 5}, but it ends up scaling both the markersize and linewidth together instead of setting them independently. Essentially, markersize has no effect for some reason.

Edit: Added plot and code to show the 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 markersize 1 and 10, respectively. As shown, they appear to have the same markersize. The last figure uses line.linewidth=10 line.markersize=1, which enlarges both the linewidth and markersize.

Marker Size 1

Marker Size 10

Marker and line size 10

Chuckhole answered 5/4, 2016 at 3:50 Comment(1)
Solution:linkChuckhole
F
1

you can import seaborn to get the pretty layout, and plot using matplotlib, to get easier/better config tools.

with matplotlib you can just make 2 plots on the same figure, a scatter plot (with markersize arbitrary) and a line plot with linewidth arbitrary as well

hope that helps

Fetishism answered 24/1, 2017 at 12:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.