-
-
Notifications
You must be signed in to change notification settings - Fork 310
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 show_data for band #2497
Add show_data for band #2497
Conversation
Compile Times benchmarkNote, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running: using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
|
Looks good, the only thing is that I think Oh and what happens with vertical bands or flipped densities? |
Do we have (x, x, y) bands? I don't see a keyword or plot method for it. |
Oh it's a raw input of Points. I'll have to tweak this then.
Some thoughts:
|
I got stuck for a while trying to figure out a direct way to find the line I need to draw and ultimately just used an iterative method. Now it can handle densities in inner = [(1 + rand()) * Point2f(cos(phi), sin(phi)) for phi in range(0, 2pi, length=51)]
outer = [(4 + rand()) * Point2f(cos(phi), sin(phi)) for phi in range(0, 2pi, length=51)]
fig, ax, p = band(inner, outer)
di = DataInspector(fig)
fig You can also swap outer and inner without issues. (It will break if the quads look like |
Description
Adds a custom
show_data
forband
which displays the x position of the mouse and the relevant (interpolated) min and max value of the band at that x value. This also affectsdensity
and whatever else relies onband
. Currently this shows a bounding box for the underlying mesh.I'm making the assumptions that
band
is used in 2Dplot.converted
plots.converted
is always 2 Point2f arrays, with the first being low values and the second being high valuesExample with
density(rand(100))
: (3rd commit)Type of change
Well technically it's changing the current behavior but a bounding box is not a useful thing to get here...
Checklist
Added or changed relevant sections in the documentationAdded unit tests for new algorithms, conversion methods, etc.Added reference image tests for new plotting functions, recipes, visual options, etc.