-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Scatterplot Method added #3473
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
Conversation
Adding one method per type of plot would pollute the DataFrame namespace too much. |
i'll take a look |
echoing @y-p, i'd rather have |
+1 to kind='scatter' On Sat, Sep 21, 2013 at 8:44 PM, Phillip Cloud [email protected]:
|
I'm relatively new to git and working through the rebase process. I may have just tangled up my code during the rebase process (grrrr.....) so perhaps I will just fork master and start over. |
do this: git remote add upstream git://github.com/pydata/pandas.git # if you haven't already
git checkout master
git fetch upstream
git rebase upstream/master
git checkout --branch zachcp-awesome-branch-of-greatness
git cherry-pick 485ac8b 3d2819d 7aff758 |
Thanks @cpcloud. I almost actually typed With the code in pull request #4930 I can do this:
not sure how elegant the code is but it works! |
@zachcp need to rebase to master
then you can
to squash(s) down to 1 commit then
|
fyi...is #4493 related (can you add a test for this)? |
@jreback no that's a matplotlib version issue |
related to matplotlib's use of the |
@cpcloud ok....thxs |
@zachcp looks like u forgot to remove some merge conflict markers, i.e., things like gotta keep rebasing ... sorry about that ... things are moving quickly around here 😄 |
@zachcp can you squash this down to 1 or 2 commits? thanks |
hmm. squashing didn't work quite as planned..... master is a moving target for rebasing. |
You're probably just misunderstanding how rebasing works. Do this: # go to master
git checkout master
# get the latest upstream
git fetch upstream
git rebase upstream/master
# new branch to put your commits
git checkout -b new-plotting-branch
# now for the fun stuff
git rev-list --reverse upstream/master..scatterplot --author="$(git config user.name)" | while read commit; do
git cherry-pick $commit
done |
Okay, you've still got some history in there. Do the following: git checkout scatterplot
git reset HEAD~1
git stash
git fetch upstream
git rebase upstream/master
git reset --hard upstream/master
git stash pop
git add .
git commit -m'YOUR AWESOME MESSAGE HERE' |
|
It's important to learn how to use Good thing about |
@zachcp I tried out your branch, and I think there are still some issues with it. When trying out some
I think you should try out some examples and some corner cases to test the code you are writing. |
@Zachp can you run flake8 on this file? It'll reveal many of these errors. |
@zachcp would like to get this in for 0.13... think u can get @jorisvandenbossche's issues addressed in the next 2 weeks-ish? |
@cpcloud and @jorisvandenbossche I updated the scatter plot class and tests to address several of Joris's issues. You will raise a
Looking through the code it looks like plotting was developed in parallel with functions like In realistic terms I can probably get the axis labels incorporated in time. The logic for subplotting using the 'by' keyword (subplots) may take longer. |
@zachcp At the moment, the code in your PR is not working (even not for the most simple case). You should really try it yourself if it's working or not. But apart from that, it are only minor bugs why it is not working, and for the rest it is almost ready I think! |
Thanks @jorisvandenbossche . I updated the code as per your suggestions. I'm deeply sorry about the code not working. I certainly value the time you are putting in and am not intentionally making more work for you. I broke my matplotlib installation on my home computer when removing MacPorts and the fix has eluded me. Right now plotting is broken on my home computer, however as I am using Github to syn code between computers I posted untested code; I should have noted that. However, I believe this recent PR corrects the issues you have mentioned and should work, but I cannot check until tomorrow at work. Hopefully that will be sufficient and I can do a final rebase/squash. Thanks again. |
MPLPlot.__init__(self, data, **kwargs) | ||
self.kwds.setdefault('c', self.plt.rcParams['patch.facecolor']) | ||
self.x = x | ||
self.y = y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put these lines at the end of the __init__
function? Because now the following lines have no effect on self.x/y
, which are used in _make_plot
and _post_plot_logic
(or you can also use self.x/y
in the following lines)
@zachcp Only a last comment now from my side! |
@Zachp You should also see if the tests pass. Can you set up Travis? You can find some explanation here to do that: https://github.com/pydata/pandas/blob/master/CONTRIBUTING.md#getting-travis-ci-going (really easy, you can just use your github account). The only thing you will have to do is push again to trigger Travis (eg a rebase and force push) |
@jorisvandenbossche the last build passed Travis-CI. It looked good on the Travis-CI website although I don't know why it reflect here. I just rebased and pushed with --force so hopefully we'll be all good |
@zachcp the travis status wil lreport here if you have followed all of the instructions; pls make sure that you enabled it on the github side as well |
@jreback I checked my Travis status and everything seems to check out. Travis is testing commits and on the Github side the webhook I just did a fresh rebase/push. |
@zachcp looks like travis is stalled..... |
@jreback Ah, I hadn't yet seen your comment:-) |
this passed (travis still hasn't updated github..but I think they are catching up)... any more comments, @jorisvandenbossche ? @jtratner ? going to merge |
actually I realized, need to update the docstring for |
which docstring are you referring to? the |
@zachcp yes...you are right...didn't see that...ok...pls add a release notes entry and you can put the same entry in v0.13.0 as well (in API changes) |
@jreback OK. I got the v.0.13.0 (in API changes) but where else in release notes do you want it. It seems to me all of the release notes are in sub-categories and I've added a line under API changes |
doc/source/release.rst under API changes for 0.13.0 |
done. |
@@ -210,6 +210,7 @@ API Changes | |||
- Default export for ``to_clipboard`` is now csv with a sep of `\t` for | |||
compat (:issue:`3368`) | |||
- ``at`` now will enlarge the object inplace (and return the same) (:issue:`2578`) | |||
- `df.plot()` can now use kind=`scatter` (:issue:`3473`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be issue 2215
@cpcloud @jorisvandenbossche @jreback Thank you for your time, suggestions, and patience during this PR; I learned quite a bit. |
@@ -210,6 +210,7 @@ API Changes | |||
- Default export for ``to_clipboard`` is now csv with a sep of `\t` for | |||
compat (:issue:`3368`) | |||
- ``at`` now will enlarge the object inplace (and return the same) (:issue:`2578`) | |||
- `df.plot()` can now use kind=`scatter` (:issue:`2215`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really minor comment: this should be double backquotes for df.plot
and normal quotes around scatter (to nitpick on rst things).
Double backquotes are for inline literal (so eg code), while single backquotes are for 'interpreted' text (text with a certain role associated, eg the :issue:
2578``
I just saw this: http://stackoverflow.com/questions/19415027/python-pandas-scatterplot-error-is-this-a-bug-with-pandas, saying something like this will work:
But at the moment I suppose sepcifying columns as strings will only work for |
Are all the back quote issues fixed? I thought single back quotes were a |
i'll fix this on merge |
merged, thanks @zachcp |
@jtratner I looked it up, and the single backquotes is defined as 'interpreted text' (http://docutils.sourceforge.net/docs/user/rst/quickref.html#inline-markup), and you can give different 'interpreted text roles' as |
closes #2215
This is a simple pull request that creates a shortcut for scatter plots from a df. This is in reference to #2215 (and #1527) and follows the same pattern as df.hist().
I followed the same pattern as df.hist() even though it looks like you are intended make a class object for scatterplots that can be passed to the plot_frame() function as is the case for BarPlot and LinePlot. In any case, this works and may be useful.
best,
zach cp