Therefore want to show the log of the counts rather than the counts. In some cases, your density map might have a high dynamic range, and you might Non-linear stretches for high dynamic range plots scatter_density ( x, y, color = 'blue' ) ax. scatter_density ( x, y, color = 'red' ) x = np. Here is an example of using the color option: import numpy as np import matplotlib.pyplot as plt import mpl_scatter_density # noqa fig = plt. TheĬolormap will fade to transparent, which means that this mode is ideal when To automatically make a monochromatic colormap based on this color. color: this can be set to any valid matplotlib color, and will be used.downres_factor: this is an integer that is used to determine how much toĭownsample the density map when panning in interactive mode.It to None to use the default for the Matplotlib backend you are using. By default, this is 72, but you can change it as needed, or set dpi: this is an integer that is used to determine the resolution of theĭensity map.The scatter_density method takes the same options as imshow (for exampleĬmap, alpha, norm, etc.), but also takes the following optional add_subplot ( 1, 1, 1, projection = 'scatter_density' ) ax. normal ( 3, 1, N ) # Make the plot - note that for the projection option to work, the # mpl_scatter_density module has to be imported above. import numpy as np import mpl_scatter_density import matplotlib.pyplot as plt # Generate fake data N = 10000000 x = np. Scatter_density method in addition to all the usual methods ( scatter, This will return a ScatterDensityAxes instance that has a Projection='scatter_density' option (if your reaction is ‘wait, what?’, see Then create Matplotlib axes as usual but adding a The easiest way to use this package is to simply import mpl_scatter_density,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |