SRS, Jupyter, matlibplot, numby and other related packages are pretty good software. They are quite widely used by scientists and others doing work such as data analysis and presentation. My simple charts were written in python and put in a Jupyter notebook. A package called matplotlib produces the charts. As an example, I’ve changes the data a bit since posting the link but this is pretty much the code I used for the rotating pie chart. %matplotlib agg import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from IPython.display import HTML labels = ['R', 'V', 'I', 'B', ' G', 'Y', 'O'] explode = (0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01) colors = ['red', 'violet', 'indigo', 'blue', 'green', 'yellow', 'orange'] nums = [10, 22, 20, 18, 16, 14, 12] plt.rcParams["animation.html"] = "jshtml" fig, ax = plt.subplots() def update(num): ax.clear() ax.axis('equal') ax.pie(nums, explode=explode, labels=labels, colors=colors, autopct='%1.1f%%', shadow=True, startangle=434 - num * 2) ani = FuncAnimation(fig, update, frames=range(179), interval=50, repeat=False) HTML(ani.to_jshtml())
The Jupyter notebooks provide code cells (various languages supported) and markdown cells. Markdown provide something similar to HTML. So you can have a mixture in a document. The next thing for me was to export the notebook to html. I used nbconvert for this: jon@jonlaptop:~/pyjupyter> jupyter nbconvert --no-input pies1.ipynb --to html --no-input tells the program not to include the code in the html. That done, I just uploaded the html pages to jonbanjo.com which is hosted by Web Hosting UK. For a little play today, I decided to have a quick look at getting data from spreadsheets and databases. For the database one, I used a mariadb I’d created a few years ago for the King James Bible. The task was to find our how many times the word “Jesus” occurred in the 4 gospels. Here is my attempt. Again, html produced by converting a Jupyter notebook, this time leaving the code in place. -- I used to host folkinfo from home mainly because of the requirements of the abc routines I used. Mandolintab.net managed to host the abcconverter part on what I think was shared hosting but it couldn’t be done with my current web hosts. Without the folkinfo need, I’ve avoided having any home hosted stuff.
|