How to setup matplotlib on Cloud9 properly?



I have done some research online to see how to get matplotlib to work with Cloud9.However, I cannot get it to work. I wonder if anyone can help me with this. Below is the code I have so far.

import os
import matplotlib
# Force matplotlib to not use any Xwindows backend.
import matplotlib.pyplot as plt

squares = [1, 4, 9, 16, 25]
os.getenv('IP', '')
os.getenv('PORT', '8080')


I haven’t tried it myself yet but I found this on stackoverflow:

matplotlib in c9