Skip to content
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

Proof of concept Recipes for Plots #11

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Conversation

csimal
Copy link

@csimal csimal commented Aug 14, 2021

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.

@csimal
Copy link
Author

csimal commented Aug 14, 2021

Note: It goes without saying that this PR is not really meant to be merged into the main branch. It's just a preliminary.

@RalphAS
Copy link
Owner

RalphAS commented Aug 16, 2021

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.

@csimal csimal marked this pull request as draft August 17, 2021 11:27
@csimal
Copy link
Author

csimal commented Aug 17, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants