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)
|
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
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user