How to use the colorcet.palette.CET_R2 function in colorcet

To help you get started, we’ve selected a few colorcet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ChairOfStructuralMechanicsTUM / Mechanics_Apps / WaveletApp / main.py View on Github external
def Plot_WT(a,b,W):
    """
    This function plots theWavelet transform
    input: 
        a: array_like of size (1xResolut), discretization of the y-axis
        b: array_like of size (1xResolut), discretization of the x-axis
        W: array_like of size (ResolutxResolut), matrix containing the wavelet transform value at each (a,b)
        
    """
    WaveLet_source.data = {'a': [a],'b':[b],'W':[W]}
    plot_Wavelet.image(image="W", source=WaveLet_source, palette=cc.palette.CET_R2, x=0, y=0, dw=5, dh=5)
    color_bar.ticker = BasicTicker()
    color_mapper.low = W.min()
    color_mapper.high = W.max()
github ChairOfStructuralMechanicsTUM / Mechanics_Apps / WaveletApp / main.py View on Github external
###########
# FIGURES #
###########
toolset=["save, wheel_zoom, reset"]
plot_function = Figure(x_range=(0, 5), y_range=(-3, 3), 
                        x_axis_label='t', y_axis_label='f(t)',
                        tools =toolset,
                        title="Function in the Original Domain",  width=650, height=300)
plot_function.toolbar.logo = None

plot_Wavelet = Figure(x_range=(0, 5), y_range=(0, 5),
                            x_axis_label='b', y_axis_label='a',
                            tools =toolset,
                            title="Wavelet Transform of the Function",  width=650, height=300)
plot_Wavelet.toolbar.logo = None
color_mapper = LinearColorMapper(palette=cc.palette.CET_R2)
color_bar = ColorBar(color_mapper=color_mapper,
                     label_standoff=12, border_line_color=None, location=(0,0))
plot_Wavelet.add_layout(color_bar, 'right')

plot_Wavelet_Function = Figure(x_range=(-10, 10), y_range=(-2, 2),
                            x_axis_label='t', y_axis_label = ""u"\u03A8 (t)",
                            tools=toolset,
                            title="Wavelet Function",  width=650, height=300)
# plot_Wavelet_Function.yaxis.axis_label = ""u"\u03A8 (t)" 
plot_Wavelet_Function.toolbar.logo = None

# sample functions with corresponding id
sample_f_names = [
    ("Heaviside function","Heaviside function"),
    ("Rectangular function","Rectangular function"),
    ("Dirac delta function","Dirac delta function"),