JuliaPlots / Plots.jl

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

smooth=true for log axes #2227

Open aahaselgrove opened 4 years ago

aahaselgrove commented 4 years ago

When using log axes (i.e. axis=:log), I would expect smooth=true to give a visually smooth line through the points (i.e. a power regression). Currently, it gives a linear regression regardless of axis settings, just displaying another line on the plot.

using Plots(); pyplot()

x = [3, 4, 5, 6, 7]
y = [9, 16, 25, 36, 49]
plot(x, y, marker=:circle, smooth=true)

Figure_1

using Plots(); pyplot()

x = [3, 4, 5, 6, 7]
y = [9, 16, 25, 36, 49]
plot(x, y, marker=:circle, axis=:log, smooth=true)

Figure_2

mkborregaard commented 4 years ago

I agree - an implementation should then force a recalculation of the smoother series whenever the scales are changed.