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

View File

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