Search code examples
pythonpandasmatplotlibazure-machine-learning-service

Trouble in creating graphics with matplotlib in a Jupyter notebook


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)


Solution

  • Have you set the backend?

    %matplotlib inline
    

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