-
Notifications
You must be signed in to change notification settings - Fork 137
ENH/REF: Accept style args; use plot, not scatter. #155
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
Conversation
Oops, the "good" and "bad" images are swapped, but you can see what I'm going for. |
Turn of auto-scaling in the axes before you do the plot or manually set the The default extent is to put the pixel centers on the integers which means On Thu, Sep 11, 2014 at 4:43 PM, Dan Allan notifications@github.com wrote:
Thomas Caswell |
OK, that makes sense. This is a leaner way to get the same result. |
vmin=kwargs.get('vmin'), vmax=kwargs.get('vmax')) | ||
ax.set_xlim(0, superimpose.shape[1]*mpp) | ||
ax.set_ylim(0, superimpose.shape[0]*mpp) | ||
ax.set_xlim(-0.5, (superimpose.shape[1] - 0.5) * mpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need the mpp on the lower limit as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Updated.
On Fri, Sep 12, 2014 at 10:40 AM, Thomas A Caswell <notifications@github.com
wrote:
In trackpy/plots.py:
vmin=kwargs.get('vmin'), vmax=kwargs.get('vmax'))
ax.set_xlim(0, superimpose.shape[1]*mpp)
ax.set_ylim(0, superimpose.shape[0]*mpp)
ax.set_xlim(-0.5, (superimpose.shape[1] - 0.5) \* mpp)
you need the mpp on the lower limit as well
—
Reply to this email directly or view it on GitHub
https://github.com/soft-matter/trackpy/pull/155/files#r17482005.
a279619
to
bb81d8d
Compare
@@ -361,3 +384,20 @@ def plot_displacements(t, frame1, frame2, scale=1, ax=None, **kwargs): | |||
ax.set_xlim(arrow_specs.x.min(), arrow_specs.x.max()) | |||
ax.set_ylim(arrow_specs.y.min(), arrow_specs.y.max()) | |||
return ax | |||
|
|||
|
|||
def _normalize_kwargs(kwargs, kind='patch'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be pushed upstream....but that is neither here nor there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIX: Add missing line to respect user color choice.
416e77c
to
6c35a35
Compare
ENH/REF : Accept style args; use plot, not scatter.
Now
annotate
usesplot
, which is both faster and more flexible thanscatter
in this context. It accepts dictionaries inplot_style
andimshow_style
which override hard-coded defaults.There is some funny-business with
extent
aimed at getting this:not this:
@tacaswell if you know a better way, have at it!