Lyrics & Knowledge Personal Pages Record Shop Auction Links Radio & Media Kids Membership Help
The Mudcat Cafesj



User Name Thread Name Subject Posted
Jon Freeman DECLUTTER * Health/Home Ecologic-Innovation *2023 (1376* d) RE: DECLUTTER * Health/Home Ecologic-Innovation *2023 23 Jul 23


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.




Back to the Main Forum Page

By clicking on the User Name, you will requery the forum for that user. You will see everything that he or she has posted with that Mudcat name.

By clicking on the Thread Name, you will be sent to the Forum on that thread as if you selected it from the main Mudcat Forum page.
   * Click on the linked number with * to view the thread split into pages (click "d" for chronologically descending).

By clicking on the Subject, you will also go to the thread as if you selected it from the original Forum page, but also go directly to that particular message.

By clicking on the Date (Posted), you will dig out every message posted that day.

Try it all, you will see.