added xlims/ylims support in plotly

This commit is contained in:
Thomas Breloff 2015-12-17 00:14:38 -05:00
parent bee1ce401a
commit 30ef8456c3
2 changed files with 13 additions and 3 deletions

View File

@ -157,6 +157,11 @@ function get_plot_json(plt::Plot{PlotlyPackage})
)
end)
lims = d[:xlims]
if lims != :auto && limsType(lims) == :limits
d_out[:xaxis][:range] = lims
end
# y-axis
d_out[:yaxis] = Dict(
:title => d[:ylabel],
@ -178,6 +183,11 @@ function get_plot_json(plt::Plot{PlotlyPackage})
)
end)
lims = d[:ylims]
if lims != :auto && limsType(lims) == :limits
d_out[:yaxis][:range] = lims
end
# legend
d_out[:showlegend] = d[:legend]
if d[:legend]
@ -189,7 +199,7 @@ function get_plot_json(plt::Plot{PlotlyPackage})
end
# annotations
anns = d[:annotation_list]
anns = get(d, :annotation_list, [])
if !isempty(anns)
d_out[:annotations] = [get_annotation_dict(ann...) for ann in anns]
end

View File

@ -462,11 +462,11 @@ supportedArgs(::PlotlyPackage) = [
:windowtitle,
:x,
:xlabel,
# :xlims,
:xlims,
:xticks,
:y,
:ylabel,
# :ylims,
:ylims,
# :yrightlabel,
:yticks,
:xscale,