out_res = options.out_res outfile = options.outfile out_formats = options.out_formats.split(',') print_mode = options.print_mode variables = options.variables.split(',') dashes = ['-', '--', '-.', ':', '-', '--', '-.', ':'] output_order = ('station', 'time', 'z', 'profile') alpha = 0.5 my_colors = colorList() try: cdict = plt.cm.datad[colormap] except: # import and convert colormap cdict = gmtColormap(colormap) cmap = colors.LinearSegmentedColormap('my_colormap', cdict) # Init Unit system sys = System() # Plotting styles axisbg = '0.9' shadow_color = '0.25' numpoints = 1 aspect_ratio = golden_mean # set the print mode lw, pad_inches = set_mode(print_mode, aspect_ratio=aspect_ratio)
vmax = options.vmax reverse = options.reverse colorbar_label = options.colorbar_label cb_extend = options.cb_extend # experimental log_color = False orientation = options.orientation # read in CPT colormap cmap_file = args[0] try: cmap = getattr(plt.cm, cmap_file) prefix = cmap_file except: # import and convert colormap cdict = gmtColormap(cmap_file, log_color=log_color, reverse=reverse) prefix = ".".join(cmap_file.split(".")[0:-1]) suffix = cmap_file.split(".")[-1] cmap = mpl.colors.LinearSegmentedColormap("my_colormap", cdict) class nlcmap(object): def __init__(self, cmap, levels): self.cmap = cmap self.levels = np.asarray(levels, dtype="float64") self._x = self.levels self.levmax = self.levels.max() self.transformed_levels = np.linspace(0.0, self.levmax, len(self.levels)) def __call__(self, xi, alpha=1.0, **kw):
reverse = options.reverse colorbar_label = options.colorbar_label cb_extend = options.cb_extend # experimental log_color = False orientation = options.orientation # read in CPT colormap cmap_file = args[0] try: cdict = plt.cm.datad[cmap_file] prefix = cmap_file except: # import and convert colormap cdict = gmtColormap(cmap_file, log_color=log_color, reverse=reverse) prefix = '.'.join(cmap_file.split('.')[0:-1]) suffix = cmap_file.split('.')[-1] if colorbar_type in ('linear'): data_values = np.linspace(vmin, vmax, N) norm = mpl.colors.Normalize(vmin=vmin, vmax=vmax) cb_extend = cb_extend format = '%2.1f' elif colorbar_type in ('gris_bath_topo'): vmin = -800 vmax = 3000 data_values = np.linspace(vmin, vmax, N) N = len(data_values) norm = mpl.colors.Normalize(vmin=vmin, vmax=vmax) cb_extend = 'both'