Seaborn:如何在factorplot中单独更改线宽和标记?

kc2*_*uno 9 python matplotlib seaborn

我明白同时scale改变两个参数,但我希望达到在大标记之间连接细线的效果.

我也尝试过调整大小rc{'lines.linewidth' = 1, 'lines.markersize' = 5},但它最终会同时缩放标记大小和线宽,而不是单独设置它们.基本上,markersize由于某种原因没有效果.

编辑:添加绘图和代码以显示问题

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)                                                       
Run Code Online (Sandbox Code Playgroud)

下面的前两个数字分别使用标记1和10创建.如图所示,它们似乎具有相同的标记.最后一个数字使用line.linewidth=10 line.markersize=1,它扩大了线宽和标记.

标记大小1

标记大小10

标记和线条大小10

epa*_*aro 1

您可以导入seaborn以获得漂亮的布局,并使用matplotlib进行绘图,以获得更简单/更好的配置工具。

使用 matplotlib,您可以在同一个图形上绘制 2 个图,一个散点图(标记大小任意)和一个线宽任意的线图

希望有帮助