-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Problem with scatter size when set xlim/ylim #16548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I find the problem can be solved in this way. |
Is there a reason you can't set |
For future reference: Only marker positions are included in auto-scaling; marker sizes are not. For really large markers this can lead to observed clipping. |
Whether exists a more convenient way to scatter with a given radius? (suppose it's a circle marker) |
Actually a different value can be set. |
@GYHHAHA Depending on what you are doing, you may be better off using https://matplotlib.org/api/_as_gen/matplotlib.patches.Circle.html It is a bit fussier to use (you will have to create the artists and add them to the axes your self), but it will let you control the size of the circles in data space (rather than in pixel space). |
An alternative workaround is to impose larger margins around the data: |
Indeed, it's more convenient to apply circle under this situation. Thanks. @tacaswell |
In addition to the options shown in the SO post OP linked to, probably the fastest option would be to use a PathCollection.
I think in view of this, it's relevant to discuss the possibility to either not deprecate |
Yes, it seems more natural. Thanks for your solution! @ImportanceOfBeingErnest |
This result of the above code shows two intersecting circles.

But if I cancel the set_xlim/set_ylim step, these two circles are separated.
So how to find a more explicit way to decide the size of scatters?
Thanks!
The text was updated successfully, but these errors were encountered: