diff --git a/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js b/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js index 0718434c75e8..46dff85a2535 100644 --- a/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js +++ b/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js @@ -151,12 +151,9 @@ define(['jupyter-js-widgets', '/nbextensions/matplotlib/mpl.js'], function(widge if (event.shiftKey && event.which == 13) { this.canvas_div.blur(); event.shiftKey = false; - // Send a "J" for go to next cell - event.which = 74; - event.keyCode = 74; - manager.command_mode(); - manager.handle_keydown(event); - } + // select the cell after this one + var index = IPython.notebook.find_cell_index(this.cell_info[0]); + IPython.notebook.select(index + 1); } } mpl.figure.prototype.handle_save = function(fig, msg) { diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index f6ef44a844d3..1f52371c67f7 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -67,7 +67,7 @@ def _get_dash_pattern(style): def _scale_dashes(offset, dashes, lw): if rcParams['_internal.classic_mode']: return offset, dashes - scale = max(1.0, lw) + scale = max(2.0, lw) scaled_offset = scaled_dashes = None if offset is not None: scaled_offset = offset * scale diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 97deb8ccea1b..2c39f69770b1 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -916,7 +916,7 @@ def validate_animation_writer_path(p): 'lines.solid_capstyle': ['projecting', validate_capstyle], 'lines.dashed_pattern': [[2.8, 1.2], validate_nseq_float()], 'lines.dashdot_pattern': [[4.8, 1.2, 0.8, 1.2], validate_nseq_float()], - 'lines.dotted_pattern': [[1.2, 0.6], validate_nseq_float()], + 'lines.dotted_pattern': [[1.1, 1.1], validate_nseq_float()], # marker props 'markers.fillstyle': ['full', validate_fillstyle], diff --git a/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.pdf b/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.pdf new file mode 100644 index 000000000000..c82443381bea Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.pdf differ diff --git a/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.png b/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.png new file mode 100644 index 000000000000..f75601b67717 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.svg b/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.svg new file mode 100644 index 000000000000..c77f9edd7b51 --- /dev/null +++ b/lib/matplotlib/tests/baseline_images/test_lines/scaled_lines.svg @@ -0,0 +1,1989 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/matplotlib/tests/test_lines.py b/lib/matplotlib/tests/test_lines.py index 0d9151dbd3bb..194777cce5a6 100644 --- a/lib/matplotlib/tests/test_lines.py +++ b/lib/matplotlib/tests/test_lines.py @@ -11,9 +11,12 @@ from nose.tools import assert_true, assert_raises from timeit import repeat import numpy as np +from cycler import cycler +import matplotlib import matplotlib.pyplot as plt from matplotlib.testing.decorators import cleanup, image_comparison + import sys @@ -180,8 +183,19 @@ def test_marker_fill_styles(): ax.set_xlim([-5, 135]) +@image_comparison(baseline_images=['scaled_lines'], style='default') +def test_lw_scaling(): + th = np.linspace(0, 32) + fig, ax = plt.subplots() + lins_styles = ['dashed', 'dotted', 'dashdot'] + cy = cycler(matplotlib.rcParams['axes.prop_cycle']) + for j, (ls, sty) in enumerate(zip(lins_styles, cy)): + for lw in np.linspace(.5, 10, 10): + ax.plot(th, j*np.ones(50) + .1 * lw, linestyle=ls, lw=lw, **sty) + + def test_nan_is_sorted(): - line = mlines.Line2D([],[]) + line = mlines.Line2D([], []) assert_true(line._is_sorted(np.array([1, 2, 3]))) assert_true(line._is_sorted(np.array([1, np.nan, 3]))) assert_true(not line._is_sorted([3, 5] + [np.nan] * 100 + [0, 2]))