From 083721bbc161fd05c94846db24699fed02879dee Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Wed, 6 Jun 2018 18:25:22 +0200 Subject: [PATCH] fix single subplot in plotly --- src/backends/plotly.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 474efb68..933b78b3 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -328,9 +328,11 @@ function plotly_layout(plt::Plot) d_out[:annotations] = KW[] + multiple_subplots = length(plt.subplots) > 1 + for sp in plt.subplots - spidx = sp[:subplot_index] - x_idx, y_idx = plotly_link_indicies(plt, sp) + spidx = multiple_subplots ? sp[:subplot_index] : "" + x_idx, y_idx = multiple_subplots ? plotly_link_indicies(plt, sp) : ("", "") # add an annotation for the title... positioned horizontally relative to plotarea, # but vertically just below the top of the subplot bounding box if sp[:title] != ""