Pseudospectra.jl
Pseudospectra.jl copied to clipboard
Proof of concept Recipes for Plots
Hi there,
I've implemented spectralportrait as a Plots Recipe as a proof of concept of how this could be done. This would allow having only one implementation for Plots that works for every backend.
Example use:
using Plots, Pseudospectra, LinearAlgebra
# pyplot() use any Plots backend
n = 150
B=diagm(1 => fill(2im,n-1), 2 => fill(-1,n-2), 3 => fill(2,n-3), -2 => fill(-4,n-2), -3 => fill(-2im, n-3))
Pseudospectra.PSAPlots.spectralportrait(B)
I'd be happy to help implement the rest of the plotting functions as recipes if needed.
Note: It goes without saying that this PR is not really meant to be merged into the main branch. It's just a preliminary.
Thanks! When I wrote most of this (several years ago) I found working with Recipes very frustrating and didn't pursue them, but if you're able to get them to handle the content here, I would be glad to replace some of my plotting hackery.
I've gotten most of the way through basic recipes. I'll add tests for these next.
Seeing as Makie is much better for interactivity, I think it might be better to leave that out for the Plots support (especially as it makes the code at lot less gory)