Skip to content

Commit abfc42a

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7157fe3 + 03eccd0 commit abfc42a

File tree

8 files changed

+32
-5
lines changed

8 files changed

+32
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ script:
8585
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples
8686
mkdir ../tmp_test_dir
8787
cd ../tmp_test_dir
88-
gdb -return-child-result -batch -ex r -ex bt --args python ../matplotlib/tests.py -sv --processes=$NPROC --process-timeout=300 $TEST_ARGS
88+
gdb -return-child-result -batch -ex r -ex bt --args python ../matplotlib/tests.py -sv --processes=$NPROC --process-timeout=300 $TEST_ARGS -q
8989
else
9090
cd doc
9191
python make.py html --small --warningsaserrors
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Changed snap threshold for circle markers to inf
2+
````````````````````````````````````````````````
3+
4+
When drawing circle markers above some marker size (previously 6.0)
5+
the path used to generate the marker was snapped to pixel centers. However,
6+
this ends up distorting the marker away from a circle. By setting the
7+
snap threshold to inf snapping is never done on circles.
8+
9+
This change broke several tests, but is an improvement.

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import matplotlib.backends.qt_editor.formlayout as formlayout
1818
from matplotlib.backends.qt_compat import QtGui
1919
from matplotlib import markers
20+
from matplotlib.colors import colorConverter, rgb2hex
2021

2122

2223
def get_icon(name):
@@ -73,20 +74,25 @@ def figure_edit(axes, parent=None):
7374
curvelabels = sorted(linedict.keys())
7475
for label in curvelabels:
7576
line = linedict[label]
77+
color = rgb2hex(colorConverter.to_rgb(line.get_color()))
78+
ec = rgb2hex(colorConverter.to_rgb(line.get_markeredgecolor()))
79+
fc = rgb2hex(colorConverter.to_rgb(line.get_markerfacecolor()))
7680
curvedata = [('Label', label),
7781
sep,
7882
(None, '<b>Line</b>'),
7983
('Style', [line.get_linestyle()] + linestyles),
8084
('Width', line.get_linewidth()),
81-
('Color', line.get_color()),
85+
('Color', color),
8286
sep,
8387
(None, '<b>Marker</b>'),
8488
('Style', [line.get_marker()] + markers),
8589
('Size', line.get_markersize()),
86-
('Facecolor', line.get_markerfacecolor()),
87-
('Edgecolor', line.get_markeredgecolor()),
90+
('Facecolor', fc),
91+
('Edgecolor', ec),
8892
]
8993
curves.append([curvedata, label, ""])
94+
# make sure that there is at least one displayed curve
95+
has_curve = bool(curves)
9096

9197
datalist = [(general, "Axes", "")]
9298
if has_curve:

lib/matplotlib/markers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def _half_fill(self):
346346

347347
def _set_circle(self, reduction=1.0):
348348
self._transform = Affine2D().scale(0.5 * reduction)
349-
self._snap_threshold = 6.0
349+
self._snap_threshold = np.inf
350350
fs = self.get_fillstyle()
351351
if not self._half_fill():
352352
self._path = Path.unit_circle()
1.01 KB
Loading
12.9 KB
Loading
757 Bytes
Loading

lib/matplotlib/tests/test_axes.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3586,6 +3586,18 @@ def test_set_get_ticklabels():
35863586
ax[1].set_yticklabels(ax[0].get_yticklabels() )
35873587

35883588

3589+
@image_comparison(baseline_images=['o_marker_path_snap'], extensions=['png'],
3590+
savefig_kwarg={'dpi': 72})
3591+
def test_o_marker_path_snap():
3592+
fig, ax = plt.subplots()
3593+
ax.margins(.1)
3594+
for ms in range(1, 15):
3595+
ax.plot([1, 2, ], np.ones(2) + ms, 'o', ms=ms)
3596+
3597+
for ms in np.linspace(1, 10, 25):
3598+
ax.plot([3, 4, ], np.ones(2) + ms, 'o', ms=ms)
3599+
3600+
35893601
@cleanup
35903602
def test_margins():
35913603
# test all ways margins can be called

0 commit comments

Comments
 (0)