Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
%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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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',
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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'))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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']