From 827dc8ca5ae666eee864660cb5dac00e549148cb Mon Sep 17 00:00:00 2001 From: rysktky Date: Wed, 9 May 2018 11:56:08 +0900 Subject: [PATCH] Fix for issue1002. subplot_titles position issue when shared axes is True and start_cell is bottom-left. --- plotly/tools.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plotly/tools.py b/plotly/tools.py index 00daae4c161..f4a34b17afa 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1324,9 +1324,15 @@ def _pad(s, cell_len=cell_len): ((delt_x + horizontal_spacing) * index)) subtitle_pos_x *= rows for index in range(rows): - subtitle_pos_y[index] = (1 - ((y_e + vertical_spacing) * index)) + if ROW_DIR > 0: + subtitle_pos_y[index] = (1 - ((y_e/rows + vertical_spacing/rows) * index)) + else: + subtitle_pos_y[index] = (1 - ((y_e + vertical_spacing) * index)) subtitle_pos_y *= cols - subtitle_pos_y = sorted(subtitle_pos_y, reverse=True) + if ROW_DIR > 0: + subtitle_pos_y = sorted(subtitle_pos_y, reverse=False) + else: + subtitle_pos_y = sorted(subtitle_pos_y, reverse=True) plot_titles = [] for index in range(len(subplot_titles)):