Simple Plots

You can create a simple plot by running a console in your favorite language.

To create a simple plot, run a console in your favorite language and paste in the following code sample:


# A standard R plot 

# A ggplot2 plot 
qplot(hp, mpg, data=mtcars, color=am, 
facets=gear~cyl, size=I(3), 
xlab="Horsepower", ylab="Miles per Gallon")


import matplotlib.pyplot as plt
import random
plt.plot([random.normalvariate(0,1) for i in xrange(1,1000)])
Cloudera Data Science Workbench processes each line of code individually (unlike notebooks that process code per-cell). This means if your plot requires multiple commands, you will see incomplete plots in the workbench as each line is processed.
To get around this behavior, wrap all your plotting commands in one Python function. Cloudera Data Science Workbench will then process the function as a whole, and not as individual lines. You should then see your plots as expected.