added xlims/ylims support in plotly
This commit is contained in:
parent
bee1ce401a
commit
30ef8456c3
@ -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
|
||||
|
||||
@ -462,11 +462,11 @@ supportedArgs(::PlotlyPackage) = [
|
||||
:windowtitle,
|
||||
:x,
|
||||
:xlabel,
|
||||
# :xlims,
|
||||
:xlims,
|
||||
:xticks,
|
||||
:y,
|
||||
:ylabel,
|
||||
# :ylims,
|
||||
:ylims,
|
||||
# :yrightlabel,
|
||||
:yticks,
|
||||
:xscale,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user