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

Skip to content

Commit f0071d7

Browse files
committed
Fix tick-alignment problem (Thanks Jörgen Stenarson)
svn path=/trunk/matplotlib/; revision=4929
1 parent 157a059 commit f0071d7

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

lib/matplotlib/lines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ def _draw_hline(self, renderer, gc, path, path_trans):
875875
path, path_trans)
876876

877877

878-
_tickhoriz_path = Path([[0.0, 0.5], [1.0, 0.5]])
878+
_tickhoriz_path = Path([[0.0, 0.0], [1.0, 0.0]])
879879
def _draw_tickleft(self, renderer, gc, path, path_trans):
880880
offset = renderer.points_to_pixels(self._markersize)
881881
marker_transform = Affine2D().scale(-offset, 1.0)
@@ -890,7 +890,7 @@ def _draw_tickright(self, renderer, gc, path, path_trans):
890890
path, path_trans)
891891

892892

893-
_tickvert_path = Path([[-0.5, 0.0], [-0.5, 1.0]])
893+
_tickvert_path = Path([[-0.0, 0.0], [-0.0, 1.0]])
894894
def _draw_tickup(self, renderer, gc, path, path_trans):
895895
offset = renderer.points_to_pixels(self._markersize)
896896
marker_transform = Affine2D().scale(1.0, offset)

src/_backend_agg.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ Py::Object
465465
RendererAgg::draw_markers(const Py::Tuple& args) {
466466
typedef agg::conv_transform<PathIterator> transformed_path_t;
467467
typedef SimplifyPath<transformed_path_t> simplify_t;
468-
typedef agg::conv_curve<transformed_path_t> curve_t;
468+
typedef agg::conv_curve<simplify_t> curve_t;
469469
typedef agg::conv_stroke<curve_t> stroke_t;
470470
typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type;
471471
typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type;
@@ -488,15 +488,15 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
488488
trans *= agg::trans_affine_translation(0.0, (double)height);
489489

490490
PathIterator marker_path(marker_path_obj);
491+
bool marker_snap = should_snap(marker_path, marker_trans);
491492
transformed_path_t marker_path_transformed(marker_path, marker_trans);
492-
curve_t marker_path_curve(marker_path_transformed);
493+
simplify_t marker_path_simplified(marker_path_transformed, marker_snap, false, width, height);
494+
curve_t marker_path_curve(marker_path_simplified);
493495

494496
PathIterator path(path_obj);
495-
bool snap = should_snap(path, trans);
496497
transformed_path_t path_transformed(path, trans);
497498
GCAgg gc = GCAgg(gc_obj, dpi);
498-
simplify_t path_simplified(path_transformed, snap, false, width, height);
499-
path_simplified.rewind(0);
499+
path_transformed.rewind(0);
500500

501501
facepair_t face = _get_rgba_face(face_obj, gc.alpha);
502502

@@ -549,7 +549,7 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
549549
agg::serialized_scanlines_adaptor_aa8::embedded_scanline sl;
550550

551551
if (has_clippath) {
552-
while (path_simplified.vertex(&x, &y) != agg::path_cmd_stop) {
552+
while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
553553
pixfmt_amask_type pfa(*pixFmt, *alphaMask);
554554
amask_ren_type r(pfa);
555555
amask_aa_renderer_type ren(r);
@@ -564,7 +564,7 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
564564
agg::render_scanlines(sa, sl, ren);
565565
}
566566
} else {
567-
while (path_simplified.vertex(&x, &y) != agg::path_cmd_stop) {
567+
while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
568568
if (face.first) {
569569
rendererAA->color(face.second);
570570
sa.init(fillCache, fillSize, x, y);

0 commit comments

Comments
 (0)