Make radial axis vertical.
This commit is contained in:
parent
12aa43ff5f
commit
f0ad851aa7
@ -306,7 +306,8 @@ function pgf_axis(sp::Subplot, letter)
|
|||||||
|
|
||||||
if !(axis[:ticks] in (nothing, false, :none)) && framestyle != :none
|
if !(axis[:ticks] in (nothing, false, :none)) && framestyle != :none
|
||||||
ticks = get_ticks(axis)
|
ticks = get_ticks(axis)
|
||||||
tick_values = ispolar(sp) && letter == :x ? rad2deg.(ticks[1]) : ticks[1]
|
#pgf plot ignores ticks with angle below 90 when xmin = 90 so shift values
|
||||||
|
tick_values = ispolar(sp) && letter == :x ? [rad2deg.(ticks[1])[3:end]..., 360, 415] : ticks[1]
|
||||||
push!(style, string(letter, "tick = {", join(tick_values,","), "}"))
|
push!(style, string(letter, "tick = {", join(tick_values,","), "}"))
|
||||||
if axis[:showaxis] && axis[:scale] in (:ln, :log2, :log10) && axis[:ticks] == :auto
|
if axis[:showaxis] && axis[:scale] in (:ln, :log2, :log10) && axis[:ticks] == :auto
|
||||||
# wrap the power part of label with }
|
# wrap the power part of label with }
|
||||||
@ -317,7 +318,8 @@ function pgf_axis(sp::Subplot, letter)
|
|||||||
end for label in ticks[2]]
|
end for label in ticks[2]]
|
||||||
push!(style, string(letter, "ticklabels = {\$", join(tick_labels,"\$,\$"), "\$}"))
|
push!(style, string(letter, "ticklabels = {\$", join(tick_labels,"\$,\$"), "\$}"))
|
||||||
elseif axis[:showaxis]
|
elseif axis[:showaxis]
|
||||||
push!(style, string(letter, "ticklabels = {", join(ticks[2],","), "}"))
|
tick_labels = ispolar(sp) && letter == :x ? [ticks[2][3:end]..., "0", "45"] : ticks[2]
|
||||||
|
push!(style, string(letter, "ticklabels = {", join(tick_labels,","), "}"))
|
||||||
else
|
else
|
||||||
push!(style, string(letter, "ticklabels = {}"))
|
push!(style, string(letter, "ticklabels = {}"))
|
||||||
end
|
end
|
||||||
@ -405,6 +407,9 @@ function _update_plot_object(plt::Plot{PGFPlotsBackend})
|
|||||||
axisf = PGFPlots.Axis
|
axisf = PGFPlots.Axis
|
||||||
if sp[:projection] == :polar
|
if sp[:projection] == :polar
|
||||||
axisf = PGFPlots.PolarAxis
|
axisf = PGFPlots.PolarAxis
|
||||||
|
#make radial axis vertical
|
||||||
|
kw[:xmin] = 90
|
||||||
|
kw[:xmax] = 450
|
||||||
end
|
end
|
||||||
|
|
||||||
# Search series for any gradient. In case one series uses a gradient set
|
# Search series for any gradient. In case one series uses a gradient set
|
||||||
|
|||||||
@ -301,7 +301,7 @@ function plotly_polaraxis(axis::Axis)
|
|||||||
ax[:range] = rad2deg.(axis_limits(axis))
|
ax[:range] = rad2deg.(axis_limits(axis))
|
||||||
else
|
else
|
||||||
ax[:range] = axis_limits(axis)
|
ax[:range] = axis_limits(axis)
|
||||||
ax[:orientation] = 0
|
ax[:orientation] = -90
|
||||||
end
|
end
|
||||||
|
|
||||||
ax
|
ax
|
||||||
|
|||||||
@ -1055,7 +1055,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
|||||||
py_set_scale(ax, axis)
|
py_set_scale(ax, axis)
|
||||||
py_set_lims(ax, axis)
|
py_set_lims(ax, axis)
|
||||||
if ispolar(sp) && letter == :y
|
if ispolar(sp) && letter == :y
|
||||||
ax[:set_rlabel_position](0)
|
ax[:set_rlabel_position](90)
|
||||||
end
|
end
|
||||||
ticks = sp[:framestyle] == :none ? nothing : get_ticks(axis)
|
ticks = sp[:framestyle] == :none ? nothing : get_ticks(axis)
|
||||||
# don't show the 0 tick label for the origin framestyle
|
# don't show the 0 tick label for the origin framestyle
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user