Skip to content

Instantly share code, notes, and snippets.

View Multiplication tables.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Multiplication_tables.py
%matplotlib widget
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
plt.rcParams['font.size']=20
#data
x = np.linspace(1,9,9)[:,np.newaxis]
y = np.linspace(1,9,9)[:,np.newaxis].T
kuku = x*y
View cmapanim.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View cmapanim.py
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage
import matplotlib.animation as animation
from IPython.display import HTML
from mpl_toolkits.axes_grid1 import make_axes_locatable
cmaps = ['turbo','viridis', 'plasma', 'inferno', 'magma', 'cividis','Greys', 'Purples',
'Blues', 'Greens', 'Oranges', 'Reds','YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu',
View seeds_counts.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View seeds_counts.py
import matplotlib.pyplot as plt
from skimage.filters import threshold_sauvola
from skimage.color import rgb2gray
from mpl_toolkits.axes_grid1 import ImageGrid
import numpy as np
from skimage.morphology import opening,square
from skimage.measure import label, regionprops
#load image
image = rgb2gray(plt.imread('sisioumaru_seeds.jpg'))
View CirclePolygon_anim.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View CirclePolygon_anim.py
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import CirclePolygon
import matplotlib.animation as animation
from IPython.display import HTML
fig, ax = plt.subplots(figsize=(6,6),subplot_kw={'aspect': 'equal'})
arttists=[]
def update(num):
if len(arttists)>0:
View labelposition.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View labelposition.py
import numpy as np
import matplotlib.pyplot as plt
x,y = np.meshgrid(np.linspace(0.1,0.9,9),np.linspace(0.1,0.9,9))
#xlabel position
fig,ax = plt.subplots(1,3,figsize=(8,3))
ax = ax.ravel()
fig.patch.set_facecolor('white')
loc=['left','center','right']