to_rgba ( neg_color ), dtype = float ) neg_color = np. to_rgba ( mid_color ), dtype = float ) if invert : min_color = np. to_rgba ( max_color ), dtype = float ) mid_color = np. """ cc = ColorConverter () max_color = np. This is beneficial in cases where there are small negative Wigner elements due to numerical round-off and/or truncation. Notes - The 'shift' parameter allows you to vary where the colormap begins to highlight negative colors. Returns - Returns a Matplotlib colormap instance for use in plotting. invert : bool Invert the color scheme for negative values so that smaller negative values have darker color. Accepts any string format compatible with the. neg_color : str Color that starts highlighting negative values. min_color : str Color corresponding to minimum data values. mid_color : str Color corresponding to zero values. max_color : str String for color corresponding to maximum value of data. This parameter should typically be negative and small (i.e -1e-5). shift : float Shifts the value at which Wigner elements are emphasized. levels : int Number of color levels to create. Parameters - W : array Wigner function array, or any array. Def wigner_cmap ( W, levels = 1024, shift = 0, max_color = '#09224F', mid_color = '#FFFFFF', min_color = '#530017', neg_color = '#FF97D4', invert = False ): """A custom colormap that emphasizes negative values by creating a nonlinear colormap.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |