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

Data labels missing on x-axis #93

Closed
sumnayak opened this issue Jul 17, 2019 · 4 comments
Closed

Data labels missing on x-axis #93

sumnayak opened this issue Jul 17, 2019 · 4 comments

Comments

@sumnayak
Copy link

sumnayak commented Jul 17, 2019

Hello,

The labels for the column names don't appear on the x-axis when I use bar and matrix plots. I tried this using Jupyter notebook, on Python 3.
I tried copying off someone else's notebook; this person has used the same code as the snippets below. They were able to print the column names, but I wasn't.

I did this on terminal first:

$ pip install quilt
$ quilt install ResidentMario/missingno_data

And then

%matplotlib inline
from quilt.data.ResidentMario import missingno_data as msno
msno.bar(df_train.sample(300))
msno.matrix(df_train.sample(300))

Bar chart:
Unknown

Matrix chart:
Unknown

@ResidentMario
Copy link
Owner

ResidentMario commented Jul 19, 2019

This is actually a feature! If you pass a dataset with more than fifty columns to missingno, the labels will default to off. The opposite is true if you pass a dataset with fewer than fifty columns.

The fifty-column breakpoint is somewhat arbitrary, but the problem it solves is not: large datasets with many, many columns would have labels that are too small to be readable, or which would collide with one another's bounding boxes, becoming gibberish.

Here's the exact code that implements this behavior. As you can see, you can override this behavior by manually specifying labels=True. For instance, change this:

%matplotlib inline
from quilt.data.ResidentMario import missingno_data as msno
msno.bar(df_train.sample(300))
msno.matrix(df_train.sample(300))

To this:

%matplotlib inline
from quilt.data.ResidentMario import missingno_data as msno
msno.bar(df_train.sample(300), labels=True)
msno.matrix(df_train.sample(300), labels=True)

You may need to pass a fontsize also, because with the default font size (16) the labels are very likely to start to overlap with one another when the number of columns is this large.

Hope that's helpful.

@sumnayak
Copy link
Author

That worked! Thank you so much

@blossomgirl96
Copy link

thanks!

@MeetPatel41011
Copy link

Thank a lot! ✨

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

4 participants