✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚾️ It's finally Baseball season! Root for the home team... & Register for our Sports Analytics Webinar!

PlotlyDisplay objects not appearing in Jupyter Notebook

import plotly.plotly as py    
import plotly.graph_objs as go  
import cufflinks as cf
import pandas as pd

crime = pd.read_csv('https://raw.githubusercontent.com/mafudge/datasets/master/crime/syracuse-crime-data-1985-2012.csv')

if metric in crimes:
    metric=input('Enter a crime metric: ')
    print(crime.iplot(kind = 'scatter', x = 'Year', y = metric, title=metric+' in Syracuse',xTitle='Year',yTitle=metric))
    print('That is not a crime metric')

Using this code I’ve noticed that my plotly graph never loads when nested in the if statement despite the fact that the tracers on either side of it will. My buddy is having the same issues. Any suggestions?