Skip to content

Instantly share code, notes, and snippets.

View AmirMardan's full-sized avatar

Amir Mardan AmirMardan

View GitHub Profile
@AmirMardan
AmirMardan / divtags.rst
Created December 13, 2023 15:29 — forked from DanielKotik/divtags.rst
Colored note boxes inside Jupyter notebooks

############# Markdown parser in Jupyter notebooks ##################

<div class="alert alert-block alert-info"> <b>NOTE</b> Use blue boxes for Tips and notes. </div>

<div class="alert alert-block alert-success"> Use green boxes sparingly, and only for some specific purpose that the other boxes can't cover. For example, if you have a lot of related content to link to, maybe you decide to use green boxes for related links from each section of a notebook.

@AmirMardan
AmirMardan / README.md
Created September 19, 2023 12:54 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

import matplotlib.pyplot as plt
import numpy as np
import PyFWI.wave_propagation as wave
import PyFWI.acquisition as acq
import PyFWI.seiplot as splt
model_shape = [100, 100]
model = {'vp': 2500 * np.ones(model_shape, np.float32),
'vs': np.zeros(model_shape, np.float32),
@AmirMardan
AmirMardan / a8d9dd57-fcc5-4841-9a5b-ab170905760c.py
Created March 21, 2022 05:02
different_plots_in_matplotlib34
fig = plt.figure()
#creating a subplot
ax1 = fig.add_subplot(1,1,1)
def animate(i):
data = open('./stock.txt','r').read()
lines = data.split('\n')
xs = []
ys = []
@AmirMardan
AmirMardan / 667590da-9156-48ea-960d-63b7c2904bf4.py
Created March 21, 2022 05:02
different_plots_in_matplotlib33
from matplotlib.animation import FuncAnimation
# Enable intractive plot
%matplotlib notebook
fig = plt.figure()
ax = plt.axes(xlim=(0, 5), ylim=(-2, 2))
line, = ax.plot([], [], lw=3)
@AmirMardan
AmirMardan / cca3e7a8-e1f5-4e5b-8ae3-3ed210ad3aba.py
Created March 21, 2022 05:02
different_plots_in_matplotlib32
fig = plt.figure(figsize=(6, 4))
ax = fig.add_subplot(121)
ax.imshow(image[:,:, 0], cmap='coolwarm')
ax = fig.add_subplot(122)
ax.imshow(image[:,:, 0], cmap='coolwarm', vmin=10, vmax=100)
@AmirMardan
AmirMardan / 8d9c5c5c-732e-44aa-be49-8d22c1a9062b.py
Created March 21, 2022 05:02
different_plots_in_matplotlib31
fig = plt.figure(figsize=(3, 3))
ax= fig.add_subplot(111)
ax.violinplot(data,
vert=False, # Plot horizontal
showmeans=False, # To show the mean
showextrema=True, # To show the extrema
showmedians=True, # To show the median
);
@AmirMardan
AmirMardan / aee6f224-5bed-4a7c-9e81-d9b7fcd91a85.py
Created March 21, 2022 05:02
different_plots_in_matplotlib30
# A simple plot
fig = plt.figure(figsize=(6, 3))
ax= fig.add_subplot(121)
ax.violinplot(data)
ax.set_title('Violin plot')
ax= fig.add_subplot(122)
ax.set_title('Box plot')
@AmirMardan
AmirMardan / c63ac9f9-8693-495e-9af0-c7f4fa55604d.py
Created March 21, 2022 05:02
different_plots_in_matplotlib29
fig = plt.figure(figsize=(3, 3))
ax= fig.add_subplot(111)
ax.boxplot(data,
notch=True, # To put a notch on median
sym='x', # Marker for outliers
vert=False, # Plot horizontal
patch_artist=True,
capprops=dict( # Property of caps
color = '#062C30', # Color
lw = 2.5, # Line width
@AmirMardan
AmirMardan / faab544f-42e6-4357-945a-e3c034962d82.py
Created March 21, 2022 05:02
different_plots_in_matplotlib28
# A simple plot
fig = plt.figure(figsize=(6, 3))
ax= fig.add_subplot(121)
ax.boxplot(data)
ax.set_title('Box plot')
ax= fig.add_subplot(122)
ax.set_title('Hist plot')