jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
14.15k stars 3.38k forks source link

Histogram Missing Axes in Output #3886

Closed neuron878 closed 6 years ago

neuron878 commented 6 years ago

When creating a histogram, the axes do not display. I'm not sure if this is just limited to histograms.

Versions: JupyterLab 0.31.5 pandas 0.22.0 matplotlib 2.1.1 numpy 1.13.3 Firefox Quantum 58.0.2 (64-bit) Windows 7 Anaconda Navigator 1.7.0

Code:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# df read in from excel file
plt.hist(df.age)
plt.show()

The output looks like this: image

However, it should look like this: image

ellisonbg commented 6 years ago

Can you try the following

On Fri, Feb 16, 2018 at 9:05 AM, neuron878 notifications@github.com wrote:

When creating a histogram, the axes do not display. I'm not sure if this is just limited to histograms.

Versions: JupyterLab 0.31.5 pandas 0.22.0 matplotlib 2.1.1 numpy 1.13.3 Firefox Quantum 58.0.2 (64-bit) Windows 7 Anaconda Navigator 1.7.0

Code:

import pandas as pd import numpy as np import matplotlib.pyplot as plt

df read in from excel file

plt.hist(df.age) plt.show()

The output looks like this: [image: image] https://user-images.githubusercontent.com/35700321/36319209-cf864312-1307-11e8-8d37-4461e8457d59.png

However, it should look like this: [image: image] https://user-images.githubusercontent.com/35700321/36319254-f84f1dc8-1307-11e8-9178-7e9fbc9c491e.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jupyterlab/jupyterlab/issues/3886, or mute the thread https://github.com/notifications/unsubscribe-auth/AABr0OHZevsd5qmucnDdnZAiwz0Fr4rsks5tVbVigaJpZM4SIo7W .

-- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

neuron878 commented 6 years ago

Sure, I followed your suggestions, but I'm still getting the same result.

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

%matplotlib inline

df = pd.read_excel("my file path")

plt.hist(df.age)

Output

(array([ 5570.,  5890.,  6048.,  6163.,  3967.,  2591.,  1595.,   496.,
          174.,    67.]),
 array([ 17. ,  24.3,  31.6,  38.9,  46.2,  53.5,  60.8,  68.1,  75.4,
         82.7,  90. ]),
 <a list of 10 Patch objects>)

image

ellisonbg commented 6 years ago

Without sharing your real data, could you create a test notebook that shows this issue and renders differently in lab versus classic notebook?

On Tue, Feb 20, 2018 at 8:03 AM, neuron878 notifications@github.com wrote:

Sure, I followed your suggestions, but I'm still getting the same result.

import pandas as pd import numpy as np import matplotlib.pyplot as plt

%matplotlib inline

df = pd.read_excel("my file path")

plt.hist(df.age)

Output

(array([ 5570., 5890., 6048., 6163., 3967., 2591., 1595., 496., 174., 67.]), array([ 17. , 24.3, 31.6, 38.9, 46.2, 53.5, 60.8, 68.1, 75.4, 82.7, 90. ]), <a list of 10 Patch objects>)

[image: image] https://user-images.githubusercontent.com/35700321/36431293-d49e39f0-161c-11e8-8ffc-24d21c01bc35.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jupyterlab/jupyterlab/issues/3886#issuecomment-367005474, or mute the thread https://github.com/notifications/unsubscribe-auth/AABr0AHbu386gnIZocO9sOhZvWOjF2Ljks5tWt66gaJpZM4SIo7W .

-- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

neuron878 commented 6 years ago

I figured out what's going on. I'm using the dark theme in JupyterLab. Since the axes and labels are black, they are being hidden. Changing the theme to light makes them appear.

This is a major drawback of using the dark theme. Is this something JupyterLab can account for? Or is this on the user to somehow configure the font of every plot to play nicely with the dark theme?

ian-r-rose commented 6 years ago

Hi @neuron878, thanks for your input. This is still an unsolved issue, there is a relevant discussion happening here: #3855.