Over the summer, I came across an interesting plotting library called GooPyCharts which is a Python wrapper for the Google Charts API. In this article, we will spend a few minutes learning how to use this interesting package. GooPyCharts follows syntax that is similar to MATLAB and is actually meant to be an alternative to matplotlib.
To install GooPyCharts, all you need to do is use pip like this:
pip install gpcharts
Now that we have it installed, we can give it a whirl!
Our First Graph
Using GooPyCharts to create a chart or graph is extremely easy. In fact, you can create a simple graph in 3 lines of code:
>>> from gpcharts import figure >>> my_plot = figure(title='Demo') >>> my_plot.plot([1, 2, 10, 15, 12, 23])
If you run this code, you should see your default browser pop open with the following image displayed:
You will note that you can download the figure as a PNG or save the data that made the chart as a CSV file. GooPyCharts also integrates with the Jupyter Notebook.