Posts

Showing posts from December, 2023

beautifyPlot: A simple matplotlib wrapper to avoid writing ‘plt.’ statements on many lines

I made a wrapper to avoid writing ‘plt.’ statements on many lines. This method also lets me save the arguments passed to matplotlib in a file for later use. GitHub repo: https://github.com/kvgc/beautifyPlot Example: matplotlib code: import numpy as np import matplotlib . pyplot as plt x = np . arange ( 0 , 100 , 1 ) y = x ** 3 plt . plot ( x , y , label = 'y=f(x)' ) plt . title ( "test plot" ) plt . xlim ([ 0 , 10 ]) plt . ylim ([ 0 , 1000 ]) plt . legend ( fontsize = 15 ) plt . tight_layout ()   Using beautifyPlot module: from beautifyPlot . bplt import beautifyPlot import numpy as np x = np . arange ( 0 , 100 , 1 ) y = x ** 3 plt . plot ( x , y , label = 'y=f(x)' ) plotArgs = { 'title' : [ 'test plot' ], ## Use list to pass a set of arguments to the function 'xlim' : [ 0 , 10 ], 'ylim' : [ 0 , 1000 ], 'legend' : { '

Disabling YouTube shorts

Image
If you are deeply frustrated with YouTube shorts (as I am), you can disable it by turning off your search history.  Activity page after turning off search history:    YouTube shorts page after turning off search history: Related : Code to block YouTube Shorts using uBlock on FireFox