0

Following the pandas documentation for visualization (https://pandas.pydata.org/pandas-docs/stable/visualization.html#visualization-hist) I am trying to create the following graphics:

import numpy as np
import pandas as pd 
import matplotlib.pyplot as plt
## A data set in my AzureML workplace experiment 
df = ds.to_dataframe()
plt.figure(); 
df.plot.hist(stacked=True, bins=20) 
plt.figure();df.boxplot()

However, the output is limited to "<matplotlib.axes._subplots.AxesSubplot at 0x7fd12e15dc18>" (for the histogram(=) and <matplotlib.axes._subplots.AxesSubplot at 0x7fd12e0ce828>" (to the box plot), but no image appearing. Can anyone help me to identify what I'm missing out? Thanks!

I'm using Python 3 in Jupyter Notebook in AzureML.

The df.describe() method works properly (there is a dataFrame)

craftApprentice
  • 2,395
  • 11
  • 51
  • 81
  • Hi, @ImportanceOfBeingErnest, don't thing that "This question has been asked before". Yes, there is a answer to this question in "How to make IPython notebook matplotlib plot inline", but the way of questioning it is different and maybe my question can help people who are having "Trouble in creating graphics with matplotlib in a Jupyter notebook". – craftApprentice Jan 23 '18 at 00:57
  • That is exactly the purpose of marking as duplicate. Independent on whether people will now look for ""Trouble in creating graphics..." or "How to make IPython..." they will be directed to the same solutions. – ImportanceOfBeingErnest Jan 23 '18 at 09:46
  • ok, @ImportanceOfBeingErnest, thanks. – craftApprentice Jan 23 '18 at 15:17

1 Answers1

2

Have you set the backend?

%matplotlib inline

Worth reading about what this does for a notebook here too Purpose of "%matplotlib inline"

emmet02
  • 872
  • 3
  • 7