Yeah, doesn’t seem GR supports this.
But this can be forced by digging into Plots.jl.
Try the following code:
Big function here...
import Plots: gr_polaraxes
function gr_polaraxes(rmin::Real, rmax::Real, sp::Plots.Subplot)
GR.savestate()
xaxis = sp[:xaxis]
yaxis = sp[:yaxis]
orig_α = 0:45:315
a = orig_α .+ 90
sinf = sind.(a)
cosf = cosd.(a)
α = collect(circshift(orig_α, 2))
rtick_values, rtick_labels = Plots.get_ticks(sp, yaxis, update = false)
# draw angular grid
if xaxis[:grid]
Plots.gr_set_line(
xaxis[:gridlinewidth],
xaxis[:gridstyle],
xaxis[:foreground_color_grid],
sp,
)
Plots.gr_set_transparency(xaxis[:foreground_color_grid], xaxis[:gridalpha])
for i in eachindex(α)
GR.polyline([sinf[i], 0], [cosf[i], 0])
end
end
# draw radial grid
if yaxis[:grid]
Plots.gr_set_line(
yaxis[:gridlinewidth],
yaxis[:gridstyle],
yaxis[:foreground_color_grid],
sp,
)
Plots.gr_set_transparency(yaxis[:foreground_color_grid], yaxis[:gridalpha])
for i in eachindex(rtick_values)
r = (rtick_values[i] - rmin) / (rmax - rmin)
if r <= 1.0 && r >= 0.0
GR.drawarc(-r, r, -r, r, 0, 359)
end
end
GR.drawarc(-1, 1, -1, 1, 0, 359)
end
# prepare to draw ticks
Plots.gr_set_transparency(1)
GR.setlinecolorind(90)
GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_HALF)
# draw angular ticks
if xaxis[:showaxis]
GR.drawarc(-1, 1, -1, 1, 0, 359)
for i in eachindex(α)
x, y = GR.wctondc(1.1 * sinf[i], 1.1 * cosf[i])
GR.textext(x, y, string((360 - α[i]) % 360, "^o"))
end
end
# draw radial ticks
if yaxis[:showaxis]
for i in eachindex(rtick_values)
r = (rtick_values[i] - rmin) / (rmax - rmin)
if r <= 1.0 && r >= 0.0
x, y = GR.wctondc(0.05, r)
Plots.gr_text(x, y, Plots._cycle(rtick_labels, i))
end
end
end
GR.restorestate()
end
This did it on my machine:
julia> plot(r, 0, 2π, proj=:polar, lims=(0,1.5));
gives:
Note, the series didn’t really change, only the axis labels, so it might be easiest to transform the data series to fit the new labels (or dig more into the code).
Plots.jl did not intend for this feature to exist… yet.
The changed bit is the:
orig_α = 0:45:315
a = orig_α .+ 90
α = collect(circshift(orig_α, 2))
at the beginning.
