JuliaPlots / Plots.jl

Powerful convenience for Julia visualizations and data analysis
https://docs.juliaplots.org
Other
1.83k stars 354 forks source link

Polar plots radial axis limits. PGFPlots #1244

Open apalugniok opened 6 years ago

apalugniok commented 6 years ago
using Plots
pgfplots()
plot(linspace(0, 2pi, 360), linspace(-1, 3, 360), proj = :polar)

polar

The interpretation of axis limits which contain negative numbers is weird instead of the radial axis starting at -1 it starts at 0 and interprets the negative limit as a literal negative radius. This leads to odd looking plots like above. Seems like the main issue for PGFPlots is that it always gives the origin of the polar plot a radius value of 0. Similarly when axis limits do not start at 0 you get

plot(linspace(0, 2pi, 360), linspace(2, 3, 360), proj = :polar)

polarpgfplots

BeastyBlacksmith commented 4 years ago

I do think those plots look fine, if you keep in mind, that the r-axis is rotated by 90 degrees. The distorted grid of the lower plot is fixed in the pgfplotsx-backend. If you want to change the axis limits, you should use the x/ylims keyword (which could get a rlims/philims alias for that reason). Keeping this issue open, since the mismatch of axis rotation and data visualization. Actually I think even that is fine.

BeastyBlacksmith commented 4 years ago

I changed my mind about this, it shouldn't be possible to have two r values on one gridline. I don't think we should allow negative r values at all, tbh.

JulianKarlBauer commented 2 years ago

The community is using workarounds: transforming the data and the ticks