This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Solve a nonlinear pendulum for a trajectory on the separatrix. | |
@author: Nicolás Guarín-Zapata | |
@date: April 2020 | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.integrate import solve_ivp |
This file contains hidden or 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
""" | |
Posterization of an image using k-means | |
It can be used to create color palettes from pictures. | |
@author:Nicolás Guarín-Zapata | |
@date: January 2020 | |
""" | |
import numpy as np | |
from scipy import misc |

This file contains hidden or 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
# Environment for polynote | |
# | |
# | |
name: polynote | |
channels: | |
- default | |
dependencies: | |
- python>=3.6 | |
- pip | |
- jedi |
This file contains hidden or 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
""" | |
Hello world (of animation)! | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
def update(data): | |
line.set_ydata(data) |

This file contains hidden or 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 matplotlib.patches as patches | |
x = np.linspace(0, 1, 100) | |
y = np.sin(4*np.pi*x) | |
# Big plot | |
ax = plt.subplot(111) | |
plt.plot(x, y, "k", zorder=3, alpha=0.4) |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
/* | |
Programmatically define a mesh for a region enclosed by a curve | |
given in parametric for for polar coordinates. | |
Author: Nicolas Guarin-Zapata | |
Date: October, 2018 | |
*/ | |
size = 0.05; | |
npts = 50; |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Minimize the best approximation to points that lie over | |
a straight line with outliers for L^p norm. | |
@author: Nicolas-Guarin-Zapata | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt |