8000 Merge pull request #546 from mdboom/issue543 · takluyver/matplotlib@257036e · GitHub
[go: up one dir, main page]

Skip to content

Commit 257036e

Browse files
committed
Merge pull request matplotlib#546 from mdboom/issue543
Issue543
2 parents 0121b98 + 7bca1b9 commit 257036e

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

lib/matplotlib/axis.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ def __init__(self, axes, loc, label,
102102
size = rcParams['%s.minor.size'%name]
103103
self._size = size
104104

105-
self._width = width # can be None for marker default
105+
if width is None:
106+
if major:
107+
width = rcParams['%s.major.width'%name]
108+
else:
109+
width = rcParams['%s.minor.width'%name]
110+
self._width = width
106111

107112
if color is None:
108113
color = rcParams['%s.color' % name]

lib/matplotlib/rcsetup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,8 @@ def __call__(self, s):
486486
# tick properties
487487
'xtick.major.size' : [4, validate_float], # major xtick size in points
488488
'xtick.minor.size' : [2, validate_float], # minor xtick size in points
489+
'xtick.major.width': [0.5, validate_float], # major xtick width in points
490+
'xtick.minor.width': [0.5, validate_float], # minor xtick width in points
489491
'xtick.major.pad' : [4, validate_float], # distance to label in points
490492
'xtick.minor.pad' : [4, validate_float], # distance to label in points
491493
'xtick.color' : ['k', validate_color], # color of the xtick labels
@@ -494,6 +496,8 @@ def __call__(self, s):
494496

495497
'ytick.major.size' : [4, validate_float], # major ytick size in points
496498
'ytick.minor.size' : [2, validate_float], # minor ytick size in points
499+
'ytick.major.width': [0.5, validate_float], # major ytick width in points
500+
'ytick.minor.width': [0.5, validate_float], # minor ytick width in points
497501
'ytick.major.pad' : [4, validate_float], # distance to label in points
498502
'ytick.minor.pad' : [4, validate_float], # distance to label in points
499503
'ytick.color' : ['k', validate_color], # color of the ytick labels

lib/matplotlib/tests/test_axes.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def test_formatter_ticker():
1515
import matplotlib.testing.jpl_units as units
1616
units.register()
1717

18+
# This should affect the tick size. (Tests issue #543)
19+
matplotlib.rcParams['lines.markeredgewidth'] = 30
20+
1821
# This essentially test to see if user specified labels get overwritten
1922
# by the auto labeler functionality of the axes.
2023
xdata = [ x*units.sec for x in range(10) ]
@@ -319,7 +322,7 @@ def test_polar_theta_position():
319322
ax.plot(theta, r)
320323
ax.set_theta_zero_location("NW")
321324
ax.set_theta_direction('clockwise')
322-
325+
323326
@image_comparison(baseline_images=['axvspan_epoch'])
324327
def test_axvspan_epoch():
325328
from datetime import datetime
@@ -508,7 +511,7 @@ def test_symlog2():
508511
ax.set_xscale('symlog', linthreshx=0.01)
509512
ax.grid(True)
510513
ax.set_ylim(-0.1, 0.1)
511-
514+
512515
@image_comparison(baseline_images=['pcolormesh'], tol=0.02)
513516
def test_pcolormesh():
514517
n = 12
@@ -542,7 +545,7 @@ def test_pcolormesh():
542545
ax.set_title('gouraud')
543546
ax.set_xticks([])
544547
ax.set_yticks([])
545-
548+
546549

547550
@image_comparison(baseline_images=['canonical'])
548551
def test_canonical():
@@ -625,7 +628,7 @@ def test_markevery_line():
625628
ax.plot(x, y, '-+', markevery=(5, 20), label='mark every 5 starting at 10')
626629
ax.legend()
627630

628-
631+
629632
if __name__=='__main__':
630633
import nose
631634
nose.runmodule(argv=['-s','--with-doctest'], exit=False)

matplotlibrc.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ backend : %(backend)s
231231
# see http://matplotlib.sourceforge.net/api/axis_api.html#matplotlib.axis.Tick
232232
#xtick.major.size : 4 # major tick size in points
233233
#xtick.minor.size : 2 # minor tick size in points
234+
#xtick.major.width : 0.5 # major tick width in points
235+
#xtick.minor.width : 0.5 # minor tick width in points
234236
#xtick.major.pad : 4 # distance to major tick label in points
235237
#xtick.minor.pad : 4 # distance to the minor tick label in points
236238
#xtick.color : k # color of the tick labels
@@ -239,6 +241,8 @@ backend : %(backend)s
239241

240242
#ytick.major.size : 4 # major tick size in points
241243
#ytick.minor.size : 2 # minor tick size in points
244+
#ytick.major.width : 0.5 # major tick width in points
245+
#ytick.minor.width : 0.5 # minor tick width in points
242246
#ytick.major.pad : 4 # distance to major tick label in points
243247
#ytick.minor.pad : 4 # distance to the minor tick label in points
244248
#ytick.color : k # color of the tick labels

0 commit comments

Comments
 (0)