-
Notifications
You must be signed in to change notification settings - Fork 5.2k
matplotlib x axis labels dissapear in scatterplot #2353
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
Comments
Not sure how we could be causing that. Maybe it's a layout issue, and the labels are getting cut off the edge of the plot? @tacaswell, any ideas? |
@Kornel Can you reproduce this without pandas? If not this should probably go to them. |
Hm, it works using matplotlib as follows:
or
This would indicate that your guess is correct - a pandas issue. However @tacaswell why does this:
work ? I can't explain that.. |
The |
Doesn't look like that, please take a look at https://github.com/Kornel/scatterplot-matplotlib/blob/master/test.py and the resulting files, e.g. https://github.com/Kornel/scatterplot-matplotlib/blob/master/scatter-3.png All is fine.. I'm calling the script using the same conda env as with jupyter simply from the cmd line: |
I am having dejavu on this issue to another on involving hexbin... |
I should google before I type: ipython/ipython#8653 which traces to pandas-dev/pandas#10678 which traces to pandas-dev/pandas#10611 which has a PR pandas-dev/pandas#12949 This can probably be closed as a pandas bug. |
Thanks @tacaswell for the detective work! |
@tacaswell well done :) thank you, however I don't quite get it why it works the way it works. Hope the pandas pr will fix it. |
try this before you import pyplot, and it works fine.
|
This problem is back as pandas 0.24.0 and 1.1.0. I submitted an issue to pandas here. Solutions that worked for me are in this SO thread. |
Please take look at http://stackoverflow.com/questions/43121584/matplotlib-scatterplot-x-axis-labels or https://github.com/Kornel/scatterplot-matplotlib/blob/master/Scatter%20plot%20x%20axis%20labels.ipynb
When I create a scatter plot with the colours specified using
c="C"
the x axis labels disappear.The solution is to provide the axes explicitly:
This looks like a jupyter issue since calling this from "regular" python with savefig does not yield this problem.
The text was updated successfully, but these errors were encountered: