gaioguys / GAIO.jl

A Julia package for set oriented computations.
MIT License
9 stars 4 forks source link

Improve visualization #26

Open cafaxo opened 4 years ago

cafaxo commented 4 years ago

Ref to #34.

MaHermann commented 4 years ago

For the coloring, a good way maybe is to have some colormap as (optional) argument. So we can define a custom mapping from scalar values of boxes to a fixed RGBA value. This way we can easily e.g. display the invariant measure either with some Red-Green color map or with different opacity values as suggested in #20.

cafaxo commented 4 years ago

Ok, but why not just do

plot(boxlist; colors = colormap.(measure))

?

By the way... this asks the question on how we want to represent measures in GAIO. I am not sure if a tuple (boxlist::BoxList, measure::Vector{Float64}) is the best way. But this is not the right place to discuss that. :)

MaHermann commented 4 years ago

I have to admit I did not have a close look at the plotting code. If this works, of course, this is what I meant.

cafaxo commented 4 years ago

This does not currently work. My suggestion was to add a "colors" argument instead of a "colormap" argument.

MaHermann commented 4 years ago

I see. Depends on what is easier to implement I guess, but colormaps seem to be more standard, while the colors way is more flexible. Don't really have an opinion on that yet.

cafaxo commented 4 years ago

Well. At the end, the renderer will take a Vector{GLBox{2}} or Vector{GLBox{3}} where

struct GLBox{N}
    center::SVector{N,Float32}
    radius::SVector{N,Float32}
    color::SVector{4,Float32}
end

We can have any number of functions that put the arguments into this format.

MaHermann commented 4 years ago

This might be more of a medium-to-long-term goal, but working with some Jupyter notebooks, I noticed that it might be helpful if a call to plot(BoxSet) did not open a new Julia-window, but return a suitable plot object, so that the plot can be viewed in a notebook or the plotting plane of Juno etc. I have to admit though that I have no idea how difficult this would be (or if it maybe even works already and I'm simply using it wrong).

cafaxo commented 4 years ago

This requires a new backend like https://github.com/JuliaPlots/WGLMakie.jl I opened issue #36 for this.