Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Errorbar markers not drawn in png output #3687

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

Merged
merged 2 commits into from
Oct 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ def test_markevery_polar():


@image_comparison(baseline_images=['marker_edges'],
remove_text=True)
remove_text=True, tol=3)
def test_marker_edges():
x = np.linspace(0, 1, 10)
fig = plt.figure()
Expand Down
17 changes: 13 additions & 4 deletions src/_backend_agg.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
theRasterizer.reset();
theRasterizer.reset_clipping();
rendererBase.reset_clipping(true);
agg::rect_i marker_size(0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF);

agg::int8u staticFillCache[MARKER_CACHE_SIZE];
agg::int8u staticStrokeCache[MARKER_CACHE_SIZE];
Expand All @@ -545,6 +546,10 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
fillCache = new agg::int8u[fillSize];
}
scanlines.serialize(fillCache);
marker_size = agg::rect_i(scanlines.min_x(),
scanlines.min_y(),
scanlines.max_x(),
scanlines.max_y());
}

stroke_t stroke(marker_path_curve);
Expand All @@ -559,6 +564,10 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
strokeCache = new agg::int8u[strokeSize];
}
scanlines.serialize(strokeCache);
marker_size = agg::rect_i(std::min(marker_size.x1, scanlines.min_x()),
std::min(marker_size.y1, scanlines.min_y()),
std::max(marker_size.x2, scanlines.max_x()),
std::max(marker_size.y2, scanlines.max_y()));

theRasterizer.reset_clipping();
rendererBase.reset_clipping(true);
Expand All @@ -570,10 +579,10 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
agg::serialized_scanlines_adaptor_aa8 sa;
agg::serialized_scanlines_adaptor_aa8::embedded_scanline sl;

agg::rect_d clipping_rect(-1.0 - scanlines.max_x(),
-1.0 - scanlines.max_y(),
1.0 + width - scanlines.min_x(),
1.0 + height - scanlines.min_y());
agg::rect_d clipping_rect(-1.0 - marker_size.x2,
-1.0 - marker_size.y2,
1.0 + width - marker_size.x1,
1.0 + height - marker_size.y1);

if (has_clippath) {
while (path_curve.vertex(&x, &y) != agg::path_cmd_stop) {
Expand Down