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('')

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?