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

Options for quiverkey when plotting motion fields #169

Open
miaoneng opened this issue Aug 14, 2020 · 1 comment
Open

Options for quiverkey when plotting motion fields #169

miaoneng opened this issue Aug 14, 2020 · 1 comment
Labels
good first issue Good for newcomers

Comments

@miaoneng
Copy link

It would be good to give an option that allow a quiverkey (legend) to be added to motion fields, otherwise it would be difficult to accurately read speed from motion plots.

See example below

20200814_090036

Since quiver function didn't return a quiver object, so it is hard to do that after the call. I modified the script in motionfield.py, I have something like

    # plot quiver
    qv1 = ax.quiver(
        X[skip],
        np.flipud(Y[skip]),
        dx[skip],
        -dy[skip],
        angles="xy",
        zorder=1e6,
        **kwargs_quiver,
    )
    w, h = plt.gcf().get_size_inches()
    plt.quiverkey(qv1, w * 0.95, h * 0.1, 10, '10 m/s', coordinates='inches')

But this is hard-coded for my own cases. It would be good to have an option to control this from the API call.

@aperezhortal aperezhortal added the good first issue Good for newcomers label Aug 15, 2020
@dnerini
Copy link
Member

dnerini commented Aug 16, 2020

Hello @Striges, your suggestion would certainly make a good addition to the quiver method in the motionfields visualization module. As you mention, your code would need to be more general so that it can handle any data resolution (default units could be "px timestep-1"). Would you like to give it a try and submit a PR ?

edit: you can find some guidelines about contributing to pysteps here

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

No branches or pull requests

3 participants