0

I use matplotlib in combiantion with pandas. It happens often that I plot several data points and I would like to select some of the points with a something like lasso tool and save this information as some kind of annotation.

For example: Lets say I plot the data of this dataframe:

        Age Score
John    18  30
Maria   11  28
Paul    20  22
Frank   15  10  
Jade    18  30
Kim     30  25
...     ..  ..

I would like to select with a lasso kind of tool the area low Age high Score I am interested about. So that, in the end, with some manipulation I could get something like that:

    Age Score   GoodCandidate
John    18  30  True    
Maria   20  28  True
Paul    60  22  False
Frank   19  10  False
Jade    18  30  True
Kim     40  25  False
...     ..  ..   ...

Suggestions how to do that?

1 Answer 1

2

If you want to drag the lasso on your own, this cookbook example might prove useful:

http://wiki.scipy.org/Cookbook/Matplotlib/Drag_n_Drop_Text_Example

if you want to find out, what is within a box or out of, this example might help:

http://matplotlib.org/examples/api/bbox_intersect.html

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I can see how this can help a bit. But is far from the answer I would like.
Yes, I see what you mean. I am afraid, I have no Idea of pandas; I just use numpy. So I cannot help you there - maybe these links give you a more easy start implementing the solution you want. As you asked for suggestions, these are mine. I cannot offer a turn key ready solution and you did not ask for it (;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.