-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Arbitrary coloring functions for streamplot
#2002
Conversation
Not sure if this should be an option for `color` or a separate kwarg. @lazarusA any thoughts?
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))
|
@asinghvi17 do you still want to fix this PR? |
I'm not sure where exactly the issue is but will look into it today or tomorrow. Seems to be a type issue so shouldn't be too hard to correct. |
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.
These changes should fix it - it turned out that color
was being set according to the palette, so I changed the attribute to color_func
.
This is because `color` is overridden by the palette, and it's generally more obvious this way in any case.
@asinghvi17 this looks ok, it does what is suppose to do. But I don't see any tests, so before merging maybe having would be a good idea. And well, the initial idea was to be able to reproduce the plots from here |
Description
Allows the user to change the streamplot's coloring function using
color = color_func(x::Point)::Number
or::Colorant
.This is a work in progress but I'm putting it up here as a base - will build on it later.
Type of change
Delete options that do not apply:
Checklist