View image_poster.py
""" | |
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 |
View polynote.yml
# Environment for polynote | |
# | |
# | |
name: polynote | |
channels: | |
- default | |
dependencies: | |
- python>=3.6 | |
- pip | |
- jedi |
View hello_anim.py
""" | |
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) |
View plot_inset_rect.py
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) |
View astro_sound.wav
This file has been truncated, but you can view the full file.
View spline_contour.geo
/* | |
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; |
View line_approx.py
#!/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 |
View vtkinterface_example.py
import vtkInterface | |
from vtkInterface import examples | |
# Load Grid | |
grid = vtkInterface.UnstructuredGrid(examples.hexbeamfile) | |
# scalar demo | |
plobj = vtkInterface.PlotClass() | |
plobj.AddMesh(grid, scalars=grid.points[:, 2], colormap='viridis') | |
plobj.AddScalarBar() |