This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jt -t monokai -f fira -fs 10 -nf ptsans -nfs 12 -ofs 12 -tfs 11 -N -kl -cursw 5 -cursc r -cellw 95% -T |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.stats as stats | |
import random as rdm | |
def add_mountain(V, idx, idy, height): | |
w,h = V.shape | |
X = np.broadcast_to(range(w), (h,w)) | |
Y = np.transpose(np.broadcast_to(range(h), (w,h))) | |
R = np.sqrt((X-idx)**2.0+(Y-idy)**2.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"output_directory": "./aux" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
import matplotlib.pyplot as plt | |
import matplotlib.patches as patches | |
# Generate network | |
N = 20 | |
p=0.2 | |
G = nx.erdos_renyi_graph(N,p) | |
# Figure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
def remove_alpha(image_path): | |
Image.open(image_path).convert('RGB').save(image_path+"rgb.jpg") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.patches as mpatches | |
import networkx as nx | |
from matplotlib.patches import FancyArrowPatch as ArrowPath | |
from matplotlib.font_manager import FontProperties | |
def draw_curved_edges(edges, pos, ax, mu=0.05, edge_color="black", edge_width=1.0, alpha=1.0, arrow_scale=20.0, loopsize=0): | |
""" | |