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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Plotting #89

Closed
dlfivefifty opened this issue Apr 29, 2021 · 10 comments
Closed

Support Plotting #89

dlfivefifty opened this issue Apr 29, 2021 · 10 comments

Comments

@dlfivefifty
Copy link
Member

We should add support for plotting using grids/transforms. Anyone have an opinion on whether to support:

馃憤 Makie
馃帀 Plots
馃殌 Both

Please vote below. @jagot @TSGut

Personally I think Makie will be really beneficial for complicated geometries like disks/triangles/etc. but perhaps Plots.jl can do this too...

@jagot
Copy link
Member

jagot commented Apr 29, 2021

I actually use neither, I use PyPlot.jl instead; as long as its not a required dependency, i.e. plotting is supported via Requires.jl, I'm fine with either. The other option is of course RecipesBase.jl, for which there seems to be no Makie equivalent yet.

@dlfivefifty
Copy link
Member Author

Actually meant:

馃憤 AbstractPlotting.jl (to support Makie.jl)
馃帀 RecipesBase.jl (to support Plots.jl)
馃殌 Both

Requires.jl might be a good solution.

@jagot
Copy link
Member

jagot commented Apr 29, 2021

RecipesBase.jl is lightweight, AbstractPlotting.jl not so much, so I would vote for Requires.jl 馃憖

@TSGut
Copy link
Member

TSGut commented Apr 29, 2021

I feel like in most of the basic uses it's already fairly straightforward to make Plots.jl do the job. For higher dimensional more complicated domains where this would be a pain to manually set up, Makie is probably superior. So I somewhat hesitantly vote AbstractPlotting / Makie. Hesitantly because it lacks a lot of convenience features, e.g. exporting as vector graphics is as far as I know still not supported.

@dlfivefifty
Copy link
Member Author

RecipesBase.jl is lightweight, AbstractPlotting.jl not so much

Yes I agree... I find the existing of two different recipe formats pretty annoying...

Perhaps best to just make a new package ContinuumArraysAbstractPlotting.jl which is loaded manually for the time being... my understanding of Requires.jl is it is then easy to to have this loaded automatically.

@dlfivefifty
Copy link
Member Author

Or... since the only packages that will use 3D are downstream (HarmonicOrthogonalPolynomials.jl and MultivariateOrthogonalPolynomials.jl) just put the dependency there

@dlfivefifty
Copy link
Member Author

Annoyingly, Makie.jl (via WGLMakie.jl) doesn't seem to be very reliable in VSCode, and is very slow...

And regular Makie.jl + InfiniteArrays.jl triggers an obscure Julia type inference bug MakieOrg/Makie.jl#933

@TSGut
Copy link
Member

TSGut commented May 3, 2021

Yeah WGLMakie even seems to state that it doesn't support VSCode yet on the documentation. Out of curiosity, is there a reason not to go for GLMakie? Well, I didn't see you already addressed that! GLMakie is the only backend that ever really worked for me, so if that's leading to serious bugs I don't think the other backends will be the solution.

@dlfivefifty
Copy link
Member Author

OK we can use Plots.jl with the plotly() backend: the following gives a plot on a disk:

julia> plotly()
Plots.PlotlyBackend()

julia> r = range(0,1;length=100);

julia> x = r' .* cospi.(2r);

julia> y = r' .* sinpi.(2r);

julia> surface(x, y, exp.(x .+ cos.(y)))

Let's do this now.

(5 years ago I used to do live demos with Makie.jl of PDEs on a disk... annoying that the situation has seemed to have gone backwards...)

@dlfivefifty
Copy link
Member Author

OK this now works:

using MultivariateOrthogonalPolynomials, Plots
plotly()
Z = Zernike()
xy = axes(Z,1)
x,y = first.(xy),last.(xy)
u = Z * (Z \ @.(cos(10x*y)))
surface(u)

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

No branches or pull requests

3 participants