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' : { ...
Here’s a fun little experiment that anyone can conduct at home with a chocolate bar and a microwave oven. Remove turntable from microwave (the plate that rotates) Take a chocolate bar on a plate and place it inside microwave. Heat for for 30-60 seconds on high. You will notice that the chocolate would have melted in some regions and not in others (see image above) . But don’t worry this is supposed to happen Source A microwave works by setting up a standing wave inside it. The size of the oven is chosen so that the peaks and troughs of the reflected microwaves line up with the incoming waves and form a “standing wave”. The above is a 1D analog of a standing wave, but a 2D standing wave looks like so: And there are nodes and anti-notes in three dimensions throughout the entire oven. At...
This post covers how to set default applications in Ubuntu from the command line using the mimeopen script. Example : Open .fits files always on ds9 ds9 is a program (stored in /home/bin/ds9) that allows astronomers to explore data (.fits files) taken at the telescope. Here's what I did to set that as the default application for opening any .fits file: ubuntu@ubuntu:~/$ mimeopen -d 22_23.fits Please choose a default application for files of type image/fits 1) home (home-usercreated-1) 2) Siril (org.free-astro.siril) 3) Munipack (xmunipack) 4) Atom (atom) 5) Other... use application #5 use command: /home/bin/ds9 Opening "22_23.fits" (image/fits) References https://unix.stackexchange.com/questions/293433/where-mimeopen-saves-default-app-config https://askubuntu.com/questions/90214/how-do-i-set-the-default-program https://linux.die.net/man/1/mimeope...
Comments
Post a Comment