Skip to content
Snippets Groups Projects
Commit 0b56b646 authored by Michele Maris's avatar Michele Maris
Browse files

u

parent 4344353b
No related branches found
No related tags found
No related merge requests found
import numpy as np
class rgb_interpolator :
"""a class to generate a 2 rgb colors interpolator """
@property
def color0(self) :
"""the 0 color"""
return self._color0
@property
def color1(self) :
"""the 1 color"""
return self._color1
def __init__(self,rgb0,rgb1) :
self._color0=np.array(rgb0,dtype=float)
self._color1=np.array(rgb1,dtype=float)
def __call__(self,x) :
if x <0 or x>1 :
raise Exception('x must be in [0,1]')
return self._color0*(1-x)+self._color1*x
class ImshowXT : class ImshowXT :
""" class to handle an improved version of plt.imshow """ """ class to handle an improved version of plt.imshow """
def __init__(self,matr,x_values,y_values,**kwargs) : def __init__(self,matr,x_values,y_values,**kwargs) :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment