-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
Legend overrides #4427
Legend overrides #4427
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)
|
This looks really useful, will probably let me move from manually constructing legends to simply specifying them in this way as well! I'd rather we support key-value pairs (maybe NamedTuples?) instead of an override object, just because it is a lot easier to learn and reason about than yet another custom object... |
Yeah I guess I'll just convert internally to |
Implements a mechanism to override legend element attributes that are normally set by copying them from the respective plot objects.
Introduces theNow uses any key-value object.LegendOverride
object, although I'm not 100% sure if we really need that as API, or should just use whatever key-value pairs we can get.The overrides can either be paired to
label
keywords (as that's the legend interface for plotting functions), or to the plotting functions themselves in theLegend
constructor (there I don't think it makes sense to pair to labels although it might be perceived as inconsistent?).Examples