-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Improve model and transform_func interaction with Axis limits #3864
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(fig)
|
ax, plot_top = heatmap(fig[1, 1], randn(10, 10), colormap = [:transparent]) | ||
# Plot some recipes at the level below the contour | ||
scatterlineplot_1 = scatterlines!(plot_top, 1:10, 1:10; linewidth = 20, markersize = 20, color = :red) | ||
scatterlineplot_2 = scatterlines!(plot_top, 1:10, 1:10; linewidth = 20, markersize = 30, color = :blue) | ||
scatterlineplot_1 = scatterlines!(ax, 1:10, 1:10; linewidth = 20, markersize = 20, color = :red) | ||
scatterlineplot_2 = scatterlines!(ax, 1:10, 1:10; linewidth = 20, markersize = 30, color = :blue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test failed because of what I'd say is undefined behavior - plotting to a primitive plot.
Specifically because data_limits
has a specific overload for Heatmap, thus using heatmap limits, while boundingbox
attempts to recognize primitives by their lack of child plots. Since heatmap has children here, boundingbox uses scatter + lines for limits.
Plotting to a primitive also results in other weirdness - the heatmap doesn't show and the axis uses tight limits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, plotting to a primitive outside a recipe?! That's something we shouldn't do in any case ;) Didn't realize we actually do this in the tests!
We should merge #3856 first, rebase and let tests run here before merging |
Description
This is an attempt at resolving issues with model transformations (
scale!
,translate!
) in Axis with or without tranform_func by relying onboundingbox
instead ofdata_limits
and undoing the transform_func afterwards. My gut feeling is that this will result in domain errors for some transformations in some situations...This should fix #3562 and similar issues.
Based on #3856 since there are some overlapping issues (hexbin typo, model application with NaN)
Type of change
Checklist