astrofrog / mpl-scatter-density

:zap: Fast scatter density plots for Matplotlib :zap:
BSD 2-Clause "Simplified" License
497 stars 25 forks source link

How to control the marker size in "scatter_density"? #34

Open WangYun1995 opened 3 years ago

mcolic commented 3 years ago

I have the same question?

scimax commented 3 years ago

Hi, I just started to use this package as well. What do you mean with marker size? Do you mean how fine the grid is? There is a parameter called dpi which changes the grid size, see the two images bellow. The first one is with dpi=30, the second with dpi=20.

image image

WangYun1995 commented 3 years ago

Hi, I just started to use this package as well. What do you mean with marker size? Do you mean how fine the grid is? There is a parameter called dpi which changes the grid size, see the two images bellow. The first one is with dpi=30, the second with dpi=20.

image image

Hi, @scimax How do the values of "density", i.e. color bar, change with dpi?

scimax commented 3 years ago

Well, due to the more coarse binning there are more scatterers in the bin with the highest intensity:

dpi=30 case: image dpi=20 case: image

WangYun1995 commented 3 years ago

Thank you for your answer @scimax. By the way, if the units of x-coordinate and y-coordinate are kilometers, is there any way to express the density as "per square kilometers", i.e. km^{-2}?