Practical Python - A plot in your browser with Bokeh
Python is a simple but powerful language, and comes with a wealth of libraries. The chart above took just 9 lines of Python. All the hard work is done by the Bokeh library. It shows the chart in your browser, where you can zoom in and move around the chart.
from bokeh.plotting import figure, show import math x_values = range(0, 720) y_values = [math.sin(math.radians(x)) for x in x_values] p = figure(title='10 Sine waves', x_axis_label='x (degrees)', \ y_axis_label='y = sin(x)', plot_width=850, plot_height=350) for i in range(10): factor = 1 - i/10 p.line(x_values, [y * factor for y in y_values])
show(p)
For more information, including a line by line explanation of the code below, see the full blog post