ShujiaHuang / qmplot

A Python package for creating high-quality manhattan and Q-Q plots from GWAS results.
GNU General Public License v3.0
37 stars 11 forks source link

How to decrease marker size in **kwargs? #6

Open andhamel opened 2 years ago

andhamel commented 2 years ago

Hello,

I'm reading through the documentation for qmplot and making a Manhattan plot. Very useful!

I was wondering if it's possible to decrease the marker size. In ax.scatter(), I can normally add in a s=size argument. How would I pass that into the Manhattan plot function? I see there is an option for **kwargs.

Thanks in advance!

ShujiaHuang commented 2 years ago

It's pretty easy. you can set marker size to be 1 by the parameter s, such as:

ax = manhattanplot(data=df,
                   sign_marker_p=1e-6,  # highline the significant SNP with ``sign_marker_color`` color.
                   is_annotate_topsnp=True,  # annotate the top SNP
                   hline_kws={"linestyle": "--", "lw": 1.3},
                   s=1,  # set the size of marker in scatter plot to be 1 (very small)
                   xticklabel_kws={"rotation": "vertical"})

Since qmplot is developed based on matplotlib, you can use any other keyword arguments which are passed to plt.scatter() in matplotlib.