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

ENH: Incorperate key list into 1DStack plot and allow for grids #81

Open
CJ-Wright opened this issue Mar 13, 2016 · 4 comments
Open

ENH: Incorperate key list into 1DStack plot and allow for grids #81

CJ-Wright opened this issue Mar 13, 2016 · 4 comments

Comments

@CJ-Wright
Copy link
Contributor

Would it be possible/what is the best way to include the key list into the 1DStack viewer? I would like to be able to include the keys in such a way as to know what lines go to which temperature/sample/arbitrary name/etc. A MPL legend probably isn't going to cut it, as there would be too many lines and would eclipse the data itself. Would it be possible to have the keys as ticks on the right hand side which match up to the data?

Also, in normal plt.plot images there is the ability to press g on the keyboard and get a grid on top of the data. Would it be possible to extend this to the 1DStack viewer?

I am more than happy to PR this, I just need to know where to look.

@tacaswell
Copy link
Member

annotate is your friend here.

To get the default keybindings do

import matplotlib.backend_bases as mbb
dey key_press(event):
    return mbb.key_press_handler(event, event.ax.figure.canvas)

canvas.mpl_connect('key_press_event', key_press)

@tacaswell
Copy link
Member

(modulo typos, it might be event.axes)

@CJ-Wright
Copy link
Contributor Author

Can I just have the key_press function as a regular function or should I make it a method of something?

@tacaswell
Copy link
Member

Look at how it is done in backend_bases. It is used there as a method of the base FigureManager class. Either one works.

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