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

[FR] Ability to resize the arrow heads in e.g. quiver plots #4881

Open
TorkelE opened this issue Jan 28, 2024 · 4 comments
Open

[FR] Ability to resize the arrow heads in e.g. quiver plots #4881

TorkelE opened this issue Jan 28, 2024 · 4 comments

Comments

@TorkelE
Copy link

TorkelE commented Jan 28, 2024

I have been trying to figure out how to do this (trying tons of various options), but currently does not seem to be possible in Plots.

It would be useful to be able to resize the arrowheads in e.g. quiver plots. E.g. for

using Plots
xs = vcat([fill(i,10) for i in 1:10]...)
ys = vcat(fill(1:10,10)...)
dxs = (0.8 .- rand(100)) ./2
dys = (0.6 .- rand(100)) ./2
quiver(xs, ys; quiver=(dxs,dys))

image

Especially when the arrow lines are small, the arrowheads looks really weird and ugly.

@j-adel
Copy link

j-adel commented Dec 15, 2024

I really suggest this arrow!() function. This issue has been there for over 7 years. I think it's time...

@BeastyBlacksmith
Copy link
Member

You are welcome to open a PR 🙂

@j-adel
Copy link

j-adel commented Dec 16, 2024

You are welcome to open a PR 🙂

It seems to me that function quiver_using_arrows(plotattributes::AKW) is already designed to have scaling arrow heads. I'm not sure if there's something preventing its use or if there's a way for the user to select it.

@BeastyBlacksmith
Copy link
Member

True, but that is only used, if the backend supports the :arrow attribute

@recipe function f(::Type{Val{:quiver}}, x, y, z)  # COV_EXCL_LINE
    @nospecialize
    if :arrow in supported_attrs()
        quiver_using_arrows(plotattributes)
    else
        quiver_using_hack(plotattributes)
    end
    ()
end

which GR currently does not:

const _gr_attrs = PlotsBase.merge_with_base_supported([

That is why it uses the other implementation

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