mplcyberpunk
mplcyberpunk copied to clipboard
Improved the capabilities of add_gradient_fill
add_gradient_fill() now supports:
- log plots (solves issue #17)
- having a tuple(minimum, maximum) alpha instead of a single float (which is still supported)
- Starting the gradient at:
- the bottom of the plot (like the underglow, solves issue #16)
- the minimum of the line (previous behaviour)
- the top of the plot
- the max of the line
- zero (the visual effect is really nice depending on the signification of the data...)
- choosing the number of sampling points
Other improvements :
- internally imshow() is called with [interpolation='bilinear'], which helps reduce the necessary sampling points for linear plots
- xlims and ylims are now saved and restored, as add_underglow() does, for the same reasons
test_plotting_gradient() shows the capabilities of this implementation:
My hopes were risen and dashed when I thought this fixed #15! 😭 EDIT: This has inspired me to look into #15 more. I've updated #15 with some findings, it may be doable, however a large iterative project if mplcyberpunk were to work for a larger assortment of plot types! 🤔
That aside, looks amazing. Great work!
Thanks !
As for #15, I might take a look at it, it might be doable
wow, this looks really awesome, especially with the docstring, tests and detailed PR! Thanks for your contribution. I've made some minor edits (mostly naming), should be fine now!
I've closed #15 and #16 as completed now.
#17 can be closed, me thinks.
Happy you like it, thanks for this cool project btw