Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add images in readme #14

Open
KronosTheLate opened this issue Jun 13, 2024 · 0 comments
Open

Add images in readme #14

KronosTheLate opened this issue Jun 13, 2024 · 0 comments

Comments

@KronosTheLate
Copy link

The following code:

using CircleFit
using GLMakie

r = 1
N = 20
σ = 0.05
θs = range(0, 360, N+1)[begin:end-1]
xs = r * cosd.(θs) + randn(N)*σ
ys = r * sind.(θs) + randn(N)*σ

fig, ax, plt = scatter(xs, ys, label="Noisy points", color=Cycled(2))
ax.aspect=DataAspect()
x_center_fit, y_center_fit, r_fit = CircleFit.pratt(xs, ys)
scatter!(x_center_fit, y_center_fit, label="Fitted Center", color=:black, markersize=20)
θs_fit = range(0, 360, 200)#[begin:end-1]
lines!(r_fit * cosd.(θs_fit), r_fit * sind.(θs_fit), label="Fitted cicle", color=:black)
leg = Legend(fig[1, 2], ax)
ax.title="True radius = $r. Fitted radius = $(round(r_fit, sigdigits=5))"#$N points on circle with radius $r.\nAdded noise with σ=$σ"
display(fig)

Procudes the following plot:
image

I am sure that such visual examples would be very nice to have in the readme (or on the documentation page).

By the way, this is something that anyone can do, and I am not specifically asking the maintainer(s) of this package to do this. View it more like a todo-note for anyone to take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant