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

Feature Request Polar Grids #9

Closed
KlausC opened this issue Jul 20, 2023 · 4 comments
Closed

Feature Request Polar Grids #9

KlausC opened this issue Jul 20, 2023 · 4 comments

Comments

@KlausC
Copy link

KlausC commented Jul 20, 2023

Additional to the Cartesian grid, which is enabled by grid=true it should be possible to enable grids for lines of
equal angles and lines of equal absolute values.
For example polargrid=true could behave like polargrid=(24, 0.3), meaning all angles which are multiples of (2π / 24)
and all absolute values which are multiples of 0.3 should be highlighted.

Additional keyword argument log=true could be used to refer the grids to log(abs(z)) instead of abs(z).

@eprovst
Copy link
Owner

eprovst commented Jul 25, 2023

Interesting suggestions, though I don't feel like domaincolor is a good fit for this as phase is already encoded by colors and magnitude by lightness ramps, maybe checkerplot is closer to what you're trying to achieve?

Passing numbers to the keywords to modify the frequencies of the lines is an interesting idea though, because the default values don't always fit well, so I'll see if I can add that.

I'm also planning to document how one could create their own plot based on the internals of the package, when ultimate flexibility is needed. Currently, all that is needed is a 'shader', e.g. a plot that shows the sign of the real part could easily be implemented as:

using DomainColoring, Colors

myshader(w) = real(w) > 0 ? colorant"red" : colorant"blue"
myplot(f, args...; kwargs...) = DomainColoring.shadedplot(f, myshader, args...; kwargs...)

For DomainColoringToy it is basically the same, but with DomainColoringToy.interactiveshadedplot instead.

But that might change a bit when we move to a Makie recipes.

@eprovst
Copy link
Owner

eprovst commented Aug 2, 2023

For instance, this would be a minimal example of your request:

using ColorTypes
import DomainColoring as DC

function myshader(w)
    gd = abs(sin(16*angle(w))*sin(5π*log(abs(w))))^0.06
    mapc(c -> gd*c, DC.labsweep(angle(w)))
end

myplot(f, args...; kwargs...) = DC.shadedplot(f, myshader, args...; kwargs...)

@eprovst
Copy link
Owner

eprovst commented Aug 7, 2023

Since the latest commit, something like domaincolor(sin, grid=(polar=(7, 10),)) would work.

@eprovst eprovst closed this as completed Aug 7, 2023
@eprovst
Copy link
Owner

eprovst commented Aug 8, 2023

Most of this request has been included in the latest release, thanks!

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

2 participants