8000 API: add `lines.scale_dashes` rcParam · matplotlib/matplotlib@b11d170 · GitHub
[go: up one dir, main page]

Skip to content

Commit b11d170

Browse files
committed
API: add lines.scale_dashes rcParam
This is something that we probably want to expose as a knob without forcing full classic mode. Closes #6998
1 parent f1753b7 commit b11d170

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

doc/users/whats_new.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ New rcparams added
8787
| | `int`, a list of floats, or ``'auto'`` if numpy |
8888
| | >= 1.11 is installed. |
8989
+---------------------------------+--------------------------------------------------+
90+
|`lines.scale_dashes` | If the line dash patterns should scale with |
91+
| | linewidth |
92+
+---------------------------------+--------------------------------------------------+
9093

9194

9295

lib/matplotlib/lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _get_dash_pattern(style):
6666

6767

6868
def _scale_dashes(offset, dashes, lw):
69-
if rcParams['_internal.classic_mode']:
69+
if not rcParams['lines.scale_dashes']:
7070
return offset, dashes
7171
scale = max(2.0, lw)
7272
scaled_offset = scaled_dashes = None

lib/matplotlib/mpl-data/stylelib/classic.mplstyle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ lines.antialiased : True # render lines in antialiased (no jaggies)
1818
lines.dashed_pattern : 6, 6
1919
lines.dashdot_pattern : 3, 5, 1, 5
2020
lines.dotted_pattern : 1, 3
21+
lines.scale_dashes: False
2122

2223
### Marker props
2324
markers.fillstyle: full

lib/matplotlib/rcsetup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ def validate_hist_bins(s):
902902
'lines.dashed_pattern': [[2.8, 1.2], validate_nseq_float()],
903903
'lines.dashdot_pattern': [[4.8, 1.2, 0.8, 1.2], validate_nseq_float()],
904904
'lines.dotted_pattern': [[1.1, 1.1], validate_nseq_float()],
905+
'lines.scale_dashes': [True, validate_bool],
905906

906907
# marker props
907908
'markers.fillstyle': ['full', validate_fillstyle],

matplotlibrc.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ backend : $TEMPLATE_BACKEND
9494
#lines.dashed_pattern : 2.8, 1.2
9595
#lines.dashdot_pattern : 4.8, 1.2, 0.8, 1.2
9696
#lines.dotted_pattern : 1.2, 0.6
97+
#lines.scale_dashes : True
9798

9899
#markers.fillstyle: full # full|left|right|bottom|top|none
99100

0 commit comments

Comments
 (0)
0