diff --git a/CHANGELOG.md b/CHANGELOG.md index 436cb14a4bd..3df1d8a1a7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [3.4.2] - UNRELEASED + +### Fixed +- `row_width` param in `plotly.tools.make_subplots` now adjusts the ranges of the xaxes intuitively from top to bottom rather than bottom to top. + ## [3.4.1] - 2018-11-09 ### Updated diff --git a/plotly/tests/test_core/test_tools/test_make_subplots.py b/plotly/tests/test_core/test_tools/test_make_subplots.py index 5e78e18f247..c81548bfed1 100644 --- a/plotly/tests/test_core/test_tools/test_make_subplots.py +++ b/plotly/tests/test_core/test_tools/test_make_subplots.py @@ -2184,7 +2184,7 @@ def test_row_width_and_column_width(self): 'x': 0.405, 'xanchor': 'center', 'xref': 'paper', - 'y': 0.1875, + 'y': 0.5625, 'yanchor': 'bottom', 'yref': 'paper'}, {'font': {'size': 16}, @@ -2193,17 +2193,17 @@ def test_row_width_and_column_width(self): 'x': 0.9550000000000001, 'xanchor': 'center', 'xref': 'paper', - 'y': 0.1875, + 'y': 0.5625, 'yanchor': 'bottom', 'yref': 'paper'}], 'xaxis': {'anchor': 'y', 'domain': [0.0, 0.81]}, 'xaxis2': {'anchor': 'y2', 'domain': [0.91, 1.0]}, 'xaxis3': {'anchor': 'y3', 'domain': [0.0, 0.81]}, 'xaxis4': {'anchor': 'y4', 'domain': [0.91, 1.0]}, - 'yaxis': {'anchor': 'x', 'domain': [0.4375, 1.0]}, - 'yaxis2': {'anchor': 'x2', 'domain': [0.4375, 1.0]}, - 'yaxis3': {'anchor': 'x3', 'domain': [0.0, 0.1875]}, - 'yaxis4': {'anchor': 'x4', 'domain': [0.0, 0.1875]}} + 'yaxis': {'anchor': 'x', 'domain': [0.8125, 1.0]}, + 'yaxis2': {'anchor': 'x2', 'domain': [0.8125, 1.0]}, + 'yaxis3': {'anchor': 'x3', 'domain': [0.0, 0.5625]}, + 'yaxis4': {'anchor': 'x4', 'domain': [0.0, 0.5625]}} }) fig = tls.make_subplots(rows=2, cols=2, subplot_titles=('Title 1', 'Title 2', 'Title 3', 'Title 4'), @@ -2238,7 +2238,7 @@ def test_row_width_and_shared_yaxes(self): 'x': 0.225, 'xanchor': 'center', 'xref': 'paper', - 'y': 0.1875, + 'y': 0.5625, 'yanchor': 'bottom', 'yref': 'paper'}, {'font': {'size': 16}, @@ -2247,17 +2247,16 @@ def test_row_width_and_shared_yaxes(self): 'x': 0.775, 'xanchor': 'center', 'xref': 'paper', - 'y': 0.1875, + 'y': 0.5625, 'yanchor': 'bottom', 'yref': 'paper'}], 'xaxis': {'anchor': 'y', 'domain': [0.0, 0.45]}, - 'xaxis2': {'anchor': 'free', 'domain': [0.55, 1.0], 'position': 0.4375}, + 'xaxis2': {'anchor': 'free', 'domain': [0.55, 1.0], 'position': 0.8125}, 'xaxis3': {'anchor': 'y2', 'domain': [0.0, 0.45]}, 'xaxis4': {'anchor': 'free', 'domain': [0.55, 1.0], 'position': 0.0}, - 'yaxis': {'anchor': 'x', 'domain': [0.4375, 1.0]}, - 'yaxis2': {'anchor': 'x3', 'domain': [0.0, 0.1875]}} + 'yaxis': {'anchor': 'x', 'domain': [0.8125, 1.0]}, + 'yaxis2': {'anchor': 'x3', 'domain': [0.0, 0.5625]}} }) - fig = tls.make_subplots(rows=2, cols=2, row_width=[1, 3], shared_yaxes=True, subplot_titles=('Title 1', 'Title 2', 'Title 3', 'Title 4')) diff --git a/plotly/tools.py b/plotly/tools.py index 3f6fd488069..21b4abcea55 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -969,6 +969,7 @@ def _checks(item, defaults): # set widths (with 'row_width') try: row_width = kwargs['row_width'] + row_width.reverse() if not isinstance(row_width, list) or len(row_width) != rows: raise Exception( "Keyword argument 'row_width' must be a list with {} "