-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: do not skip isolated points in vector outputs #8297
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
lib/matplotlib/tests/test_path.py
Outdated
@@ -117,6 +117,19 @@ def test_marker_paths_pdf(): | |||
plt.ylim(-1, 7) | |||
|
|||
|
|||
@image_comparison(baseline_images=['nan_path'], style='default', | |||
remove_text=True,extensions=['pdf', 'svg', 'eps', 'png']) |
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.
Space after ,
.
src/path_converters.h
Outdated
@@ -343,6 +343,7 @@ class PathClipper : public EmbeddedQueue<3> | |||
unsigned vertex(double *x, double *y) | |||
{ | |||
unsigned code; | |||
bool emit_moveto = false; |
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.
Our C/C++ code uses spaces as well, not tabs.
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.
gah! emacs has betrayed me!
src/path_converters.h
Outdated
// seen at least one command ? | ||
// if so, shove it in the queue if in clip box | ||
if (m_moveto && m_has_init && | ||
m_lastX >= m_cliprect.x1 && |
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.
I prefer reversing the arguments here so that it looks similar to Python's chained form.
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 matches the block further down, would rather stay consistent with that.
src/path_converters.h
Outdated
m_lastX <= m_cliprect.x2 && | ||
m_lastY >= m_cliprect.y1 && | ||
m_lastY <= m_cliprect.y2) { | ||
// push the last moveto onto the queue |
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.
moveto -> move to (or maybe the reverse for the other places would be clearer.)
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.
Actually, this comment is kind of redundant with the one above the if
.
src/path_converters.h
Outdated
m_initX = m_lastX = *x; | ||
m_initY = m_lastY = *y; | ||
m_has_init = true; | ||
m_moveto = true; | ||
// if the last command was move to exit the loop to emit the code |
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.
I mean, this is pretty clearly what it does already, so it's kind of a redundant comment. Would be better as a why instead of a what.
Have not bisected, but looking at the blame I suspect this was broken by #5911 so broken from 1.5.2 on. |
bb0d1a9
to
27d4596
Compare
Fixed bug in path interaction code where multiple moves in a row (which correspond to isolated points surrounded by nans after they have been filtered from the path) would be discarded which resulted in points not being plotted. closes matplotlib#7293
27d4596
to
5f54543
Compare
m_lastX <= m_cliprect.x2 && | ||
m_lastY >= m_cliprect.y1 && | ||
m_lastY <= m_cliprect.y2) { | ||
// push the last moveto onto the queue |
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.
I think this comment is still redundant.
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.
I wrote this as comments to my self while understanding this. I do not see a problem with leaving them.
Thanks @tacaswell ! |
This PR was about 2 LoC / hr 😆 (of changes to the source, not the surrounding tests). |
Fixed bug in path interaction code where multiple moves in a
row (which correspond to isolated points surrounded by nans after they
have been filtered from the path) would be discarded which resulted in
points not being plotted.
closes #7293