neulab/docprompting-conala huggingface dataset:
matplotlib.colors.FuncNorm   classmatplotlib.colors.FuncNorm(functions, vmin=None, vmax=None, clip=False)[source]
 
Bases: matplotlib.colors.FuncNorm Arbitrary normalization using functions for the forward and inverse.  Parameters 
 
functions(callable, callable)


two-tuple of the forward and inverse functions for the normalization. The forward function must be monotonic. Both functions must have the signature def forward(values: array-like) -> array-like
  
vmin, vmaxfloat or None


If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., __call__(A) calls autoscale_None(A).  
clipbool, default: False


If True values falling outside the range [vmin, vmax], are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If False masked values remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is clip=False.      Parameters 
 
vmin, vmaxfloat or None


If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., __call__(A) calls autoscale_None(A).  
clipbool, default: False


If True values falling outside the range [vmin, vmax], are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If False masked values remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is clip=False.     Notes Returns 0 if vmin == vmax.   __call__(value, clip=None)[source]
 
Normalize value data in the [vmin, vmax] interval into the [0.0, 1.0] interval and return it.  Parameters 
 value

Data to normalize.  
clipbool


If None, defaults to self.clip (which defaults to False).     Notes If not already initialized, self.vmin and self.vmax are initialized using self.autoscale_None(value). 
   inverse(value)[source]

 
  Examples using matplotlib.colors.FuncNorm
 
   Colormap Normalization
matplotlib.colors.get_named_colors_mapping   matplotlib.colors.get_named_colors_mapping()[source]
 
Return the global mapping of names to named colors.
matplotlib.colors.hsv_to_rgb   matplotlib.colors.hsv_to_rgb(hsv)[source]
 
Convert hsv values to rgb.  Parameters 
 
hsv(..., 3) array-like


All values assumed to be in range [0, 1]    Returns 
 (..., 3) ndarray

Colors converted to RGB values in range [0, 1]     
  Examples using matplotlib.colors.hsv_to_rgb
 
   3D voxel / volumetric plot with cylindrical coordinates
matplotlib.colors.is_color_like   matplotlib.colors.is_color_like(c)[source]
 
Return whether c can be interpreted as an RGB(A) color.
blend_hsv(rgb, intensity, hsv_max_sat=None, hsv_max_val=None, hsv_min_val=None, hsv_min_sat=None)[source]
 
Take the input data array, convert to HSV values in the given colormap, then adjust those color values to give the impression of a shaded relief map with a specified light source. RGBA values are returned, which can then be used to plot the shaded image with imshow. The color of the resulting image will be darkened by moving the (s, v) values (in hsv colorspace) toward (hsv_min_sat, hsv_min_val) in the shaded regions, or lightened by sliding (s, v) toward (hsv_max_sat, hsv_max_val) in regions that are illuminated. The default extremes are chose so that completely shaded points are nearly black (s = 1, v = 0) and completely illuminated points are nearly white (s = 0, v = 1).  Parameters 
 
rgbndarray


An MxNx3 RGB array of floats ranging from 0 to 1 (color image).  
intensityndarray


An MxNx1 array of floats ranging from 0 to 1 (grayscale image).  
hsv_max_satnumber, default: 1


The maximum saturation value that the intensity map can shift the output image to.  
hsv_min_satnumber, optional


The minimum saturation value that the intensity map can shift the output image to. Defaults to 0.  
hsv_max_valnumber, optional


The maximum value ("v" in "hsv") that the intensity map can shift the output image to. Defaults to 1.  
hsv_min_valnumber, optional


The minimum value ("v" in "hsv") that the intensity map can shift the output image to. Defaults to 0.    Returns 
 ndarray

An MxNx3 RGB array representing the combined images.
blend_overlay(rgb, intensity)[source]
 
Combine an rgb image with an intensity map using "overlay" blending.  Parameters 
 
rgbndarray


An MxNx3 RGB array of floats ranging from 0 to 1 (color image).  
intensityndarray


An MxNx1 array of floats ranging from 0 to 1 (grayscale image).    Returns 
 ndarray

An MxNx3 RGB array representing the combined images.
blend_soft_light(rgb, intensity)[source]
 
Combine an rgb image with an intensity map using "soft light" blending, using the "pegtop" formula.  Parameters 
 
rgbndarray


An MxNx3 RGB array of floats ranging from 0 to 1 (color image).  
intensityndarray


An MxNx1 array of floats ranging from 0 to 1 (grayscale image).    Returns 
 ndarray

An MxNx3 RGB array representing the combined images.
hillshade(elevation, vert_exag=1, dx=1, dy=1, fraction=1.0)[source]
 
Calculate the illumination intensity for a surface using the defined azimuth and elevation for the light source. This computes the normal vectors for the surface, and then passes them on to shade_normals  Parameters 
 
elevation2D array-like


The height values used to generate an illumination map  
vert_exagnumber, optional


The amount to exaggerate the elevation values by when calculating illumination. This can be used either to correct for differences in units between the x-y coordinate system and the elevation coordinate system (e.g. decimal degrees vs. meters) or to exaggerate or de-emphasize topographic effects.  
dxnumber, optional


The x-spacing (columns) of the input elevation grid.  
dynumber, optional


The y-spacing (rows) of the input elevation grid.  
fractionnumber, optional


Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration.    Returns 
 ndarray

A 2D array of illumination values between 0-1, where 0 is completely in shadow and 1 is completely illuminated.
shade(data, cmap, norm=None, blend_mode='overlay', vmin=None, vmax=None, vert_exag=1, dx=1, dy=1, fraction=1, **kwargs)[source]
 
Combine colormapped data values with an illumination intensity map (a.k.a. "hillshade") of the values.  Parameters 
 
data2D array-like


The height values used to generate a shaded map.  
cmapColormap


The colormap used to color the data array. Note that this must be a Colormap instance. For example, rather than passing in cmap='gist_earth', use cmap=plt.get_cmap('gist_earth') instead.  
normNormalize instance, optional


The normalization used to scale values before colormapping. If None, the input will be linearly scaled between its min and max.  
blend_mode{'hsv', 'overlay', 'soft'} or callable, optional


The type of blending used to combine the colormapped data values with the illumination intensity. Default is "overlay". Note that for most topographic surfaces, "overlay" or "soft" appear more visually realistic. If a user-defined function is supplied, it is expected to combine an MxNx3 RGB array of floats (ranging 0 to 1) with an MxNx1 hillshade array (also 0 to 1). (Call signature func(rgb, illum, **kwargs)) Additional kwargs supplied to this function will be passed on to the blend_mode function.  
vminfloat or None, optional


The minimum value used in colormapping data. If None the minimum value in data is used. If norm is specified, then this argument will be ignored.  
vmaxfloat or None, optional


The maximum value used in colormapping data. If None the maximum value in data is used. If norm is specified, then this argument will be ignored.  
vert_exagnumber, optional


The amount to exaggerate the elevation values by when calculating illumination. This can be used either to correct for differences in units between the x-y coordinate system and the elevation coordinate system (e.g. decimal degrees vs. meters) or to exaggerate or de-emphasize topography.  
dxnumber, optional


The x-spacing (columns) of the input elevation grid.  
dynumber, optional


The y-spacing (rows) of the input elevation grid.  
fractionnumber, optional


Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration.  Additional kwargs are passed on to the *blend_mode* function.
  Returns 
 ndarray

An MxNx4 array of floats ranging between 0-1.
shade_normals(normals, fraction=1.0)[source]
 
Calculate the illumination intensity for the normal vectors of a surface using the defined azimuth and elevation for the light source. Imagine an artificial sun placed at infinity in some azimuth and elevation position illuminating our surface. The parts of the surface that slope toward the sun should brighten while those sides facing away should become darker.  Parameters 
 
fractionnumber, optional


Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration.    Returns 
 ndarray

A 2D array of illumination values between 0-1, where 0 is completely in shadow and 1 is completely illuminated.
shade_rgb(rgb, elevation, fraction=1.0, blend_mode='hsv', vert_exag=1, dx=1, dy=1, **kwargs)[source]
 
Use this light source to adjust the colors of the rgb input array to give the impression of a shaded relief map with the given elevation.  Parameters 
 
rgbarray-like


An (M, N, 3) RGB array, assumed to be in the range of 0 to 1.  
elevationarray-like


An (M, N) array of the height values used to generate a shaded map.  
fractionnumber


Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration.  
blend_mode{'hsv', 'overlay', 'soft'} or callable, optional


The type of blending used to combine the colormapped data values with the illumination intensity. For backwards compatibility, this defaults to "hsv". Note that for most topographic surfaces, "overlay" or "soft" appear more visually realistic. If a user-defined function is supplied, it is expected to combine an MxNx3 RGB array of floats (ranging 0 to 1) with an MxNx1 hillshade array (also 0 to 1). (Call signature func(rgb, illum, **kwargs)) Additional kwargs supplied to this function will be passed on to the blend_mode function.  
vert_exagnumber, optional


The amount to exaggerate the elevation values by when calculating illumination. This can be used either to correct for differences in units between the x-y coordinate system and the elevation coordinate system (e.g. decimal degrees vs. meters) or to exaggerate or de-emphasize topography.  
dxnumber, optional


The x-spacing (columns) of the input elevation grid.  
dynumber, optional


The y-spacing (rows) of the input elevation grid.  Additional kwargs are passed on to the *blend_mode* function.
  Returns 
 ndarray

An (m, n, 3) array of floats ranging between 0-1.
staticfrom_list(name, colors, N=256, gamma=1.0)[source]
 
Create a LinearSegmentedColormap from a list of colors.  Parameters 
 
namestr


The name of the colormap.  
colorsarray-like of colors or array-like of (value, color)


If only colors are given, they are equidistantly mapped from the range \([0, 1]\); i.e. 0 maps to colors[0] and 1 maps to colors[-1]. If (value, color) pairs are given, the mapping is from value to color. This can be used to divide the range unevenly.  
Nint


The number of rgb quantization levels.  
gammafloat
reversed(name=None)[source]
 
Return a reversed instance of the Colormap.  Parameters 
 
namestr, optional


The name for the reversed colormap. If it's None the name will be the name of the parent colormap + "_r".    Returns 
 LinearSegmentedColormap

The reversed colormap.
set_gamma(gamma)[source]
 
Set a new gamma value and regenerate colormap.
matplotlib.colors.ListedColormap   classmatplotlib.colors.ListedColormap(colors, name='from_list', N=None)[source]
 
Bases: matplotlib.colors.Colormap Colormap object generated from a list of colors. This may be most useful when indexing directly into a colormap, but it can also be used to generate special colormaps for ordinary mapping.  Parameters 
 
colorslist, array


List of Matplotlib color specifications, or an equivalent Nx3 or Nx4 floating point array (N rgb or rgba values).  
namestr, optional


String to identify the colormap.  
Nint, optional


Number of entries in the map. The default is None, in which case there is one colormap entry for each element in the list of colors. If N < len(colors)
 the list will be truncated at N. If N > len(colors)
 the list will be extended by repetition.      Parameters 
 
namestr


The name of the colormap.  
Nint


The number of rgb quantization levels.       reversed(name=None)[source]
 
Return a reversed instance of the Colormap.  Parameters 
 
namestr, optional


The name for the reversed colormap. If it's None the name will be the name of the parent colormap + "_r".    Returns 
 ListedColormap

A reversed instance of the colormap.     
 
  Examples using matplotlib.colors.ListedColormap
 
   Multicolored lines   

   Layer Images   

   QuadMesh Demo   

   Histograms   

   Time Series Histogram   

   Nested pie charts   

   Bar chart on polar axis   

   Left ventricle bullseye   

   Customized Colorbars Tutorial   

   Creating Colormaps in Matplotlib
reversed(name=None)[source]
 
Return a reversed instance of the Colormap.  Parameters 
 
namestr, optional


The name for the reversed colormap. If it's None the name will be the name of the parent colormap + "_r".    Returns 
 ListedColormap

A reversed instance of the colormap.
matplotlib.colors.LogNorm   classmatplotlib.colors.LogNorm(vmin=None, vmax=None, clip=False)[source]
 
Bases: matplotlib.colors.LogNorm Normalize a given value to the 0-1 range on a log scale.  Parameters 
 
vmin, vmaxfloat or None


If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., __call__(A) calls autoscale_None(A).  
clipbool, default: False


If True values falling outside the range [vmin, vmax], are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If False masked values remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is clip=False.     Notes Returns 0 if vmin == vmax.   __call__(value, clip=None)[source]
 
Normalize value data in the [vmin, vmax] interval into the [0.0, 1.0] interval and return it.  Parameters 
 value

Data to normalize.  
clipbool


If None, defaults to self.clip (which defaults to False).     Notes If not already initialized, self.vmin and self.vmax are initialized using self.autoscale_None(value). 
   inverse(value)[source]

 
  Examples using matplotlib.colors.LogNorm
 
   Pcolor Demo   

   Histograms   

   Time Series Histogram   

   Colormap Normalizations   

   Basic Usage   

   Colormap Normalization
matplotlib.colors.make_norm_from_scale   matplotlib.colors.make_norm_from_scale(scale_cls, base_norm_cls=None, *, init=None)[source]
 
Decorator for building a Normalize subclass from a ScaleBase subclass. After @make_norm_from_scale(scale_cls)
class norm_cls(Normalize):
    ...
 norm_cls is filled with methods so that normalization computations are forwarded to scale_cls (i.e., scale_cls is the scale that would be used for the colorbar of a mappable normalized with norm_cls). If init is not passed, then the constructor signature of norm_cls will be norm_cls(vmin=None, vmax=None, clip=False); these three parameters will be forwarded to the base class (Normalize.__init__), and a scale_cls object will be initialized with no arguments (other than a dummy axis). If the scale_cls constructor takes additional parameters, then init should be passed to make_norm_from_scale. It is a callable which is only used for its signature. First, this signature will become the signature of norm_cls. Second, the norm_cls constructor will bind the parameters passed to it using this signature, extract the bound vmin, vmax, and clip values, pass those to Normalize.__init__, and forward the remaining bound values (including any defaults defined by the signature) to the scale_cls constructor.
matplotlib.colors.NoNorm   classmatplotlib.colors.NoNorm(vmin=None, vmax=None, clip=False)[source]
 
Bases: matplotlib.colors.Normalize Dummy replacement for Normalize, for the case where we want to use indices directly in a ScalarMappable.  Parameters 
 
vmin, vmaxfloat or None


If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., __call__(A) calls autoscale_None(A).  
clipbool, default: False


If True values falling outside the range [vmin, vmax], are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If False masked values remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is clip=False.     Notes Returns 0 if vmin == vmax.   __call__(value, clip=None)[source]
 
Normalize value data in the [vmin, vmax] interval into the [0.0, 1.0] interval and return it.  Parameters 
 value

Data to normalize.  
clipbool


If None, defaults to self.clip (which defaults to False).     Notes If not already initialized, self.vmin and self.vmax are initialized using self.autoscale_None(value). 
   inverse(value)[source]
matplotlib.colors.Normalize   classmatplotlib.colors.Normalize(vmin=None, vmax=None, clip=False)[source]
 
Bases: object A class which, when called, linearly normalizes data into the [0.0, 1.0] interval.  Parameters 
 
vmin, vmaxfloat or None


If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., __call__(A) calls autoscale_None(A).  
clipbool, default: False


If True values falling outside the range [vmin, vmax], are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If False masked values remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is clip=False.     Notes Returns 0 if vmin == vmax.   __call__(value, clip=None)[source]
 
Normalize value data in the [vmin, vmax] interval into the [0.0, 1.0] interval and return it.  Parameters 
 value

Data to normalize.  
clipbool


If None, defaults to self.clip (which defaults to False).     Notes If not already initialized, self.vmin and self.vmax are initialized using self.autoscale_None(value). 
   autoscale(A)[source]
 
Set vmin, vmax to min, max of A. 
   autoscale_None(A)[source]
 
If vmin or vmax are not set, use the min/max of A to set them. 
   propertyclip

   inverse(value)[source]

   staticprocess_value(value)[source]
 
Homogenize the input value for easy and efficient normalization. value can be a scalar or sequence.  Returns 
 
resultmasked array


Masked array with the same shape as value.  
is_scalarbool


Whether value is a scalar.     Notes Float dtypes are preserved; integer types with two bytes or smaller are converted to np.float32, and larger types are converted to np.float64. Preserving float32 when possible, and using in-place operations, greatly improves speed for large arrays. 
   scaled()[source]
 
Return whether vmin and vmax are set. 
   propertyvmax

   propertyvmin

 
  Examples using matplotlib.colors.Normalize
 
   Multicolored lines   

   Contour Image   

   Creating annotated heatmaps   

   Image Masked   

   Blend transparency with color in 2D images   

   Multi Image   

   Pcolor Demo   

   pcolormesh   

   Histograms   

   Time Series Histogram   

   Axes Grid2   

   Shaded & power normalized rendering   

   Frontpage contour example   

   Exploring normalizations   

   Hillshading   

   Left ventricle bullseye   

   Colormap Normalizations   

   Colormap Normalizations Symlognorm   

   Basic Usage   

   Constrained Layout Guide   

   Customized Colorbars Tutorial   

   Colormap Normalization
autoscale(A)[source]
 
Set vmin, vmax to min, max of A.
autoscale_None(A)[source]
 
If vmin or vmax are not set, use the min/max of A to set them.
staticprocess_value(value)[source]
 
Homogenize the input value for easy and efficient normalization. value can be a scalar or sequence.  Returns 
 
resultmasked array


Masked array with the same shape as value.  
is_scalarbool


Whether value is a scalar.     Notes Float dtypes are preserved; integer types with two bytes or smaller are converted to np.float32, and larger types are converted to np.float64. Preserving float32 when possible, and using in-place operations, greatly improves speed for large arrays.
matplotlib.colors.PowerNorm   classmatplotlib.colors.PowerNorm(gamma, vmin=None, vmax=None, clip=False)[source]
 
Bases: matplotlib.colors.Normalize Linearly map a given value to the 0-1 range and then apply a power-law normalization over that range.  Parameters 
 
vmin, vmaxfloat or None


If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., __call__(A) calls autoscale_None(A).  
clipbool, default: False


If True values falling outside the range [vmin, vmax], are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If False masked values remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is clip=False.     Notes Returns 0 if vmin == vmax.   __call__(value, clip=None)[source]
 
Normalize value data in the [vmin, vmax] interval into the [0.0, 1.0] interval and return it.  Parameters 
 value

Data to normalize.  
clipbool


If None, defaults to self.clip (which defaults to False).     Notes If not already initialized, self.vmin and self.vmax are initialized using self.autoscale_None(value). 
   inverse(value)[source]

 
  Examples using matplotlib.colors.PowerNorm
 
   Shaded & power normalized rendering   

   Exploring normalizations   

   Colormap Normalizations   

   Colormap Normalization
matplotlib.colors.rgb_to_hsv   matplotlib.colors.rgb_to_hsv(arr)[source]
 
Convert float rgb values (in the range [0, 1]), in a numpy array to hsv values.  Parameters 
 
arr(..., 3) array-like


All values must be in the range [0, 1]    Returns 
 (..., 3) ndarray

Colors converted to hsv values in range [0, 1]     
  Examples using matplotlib.colors.rgb_to_hsv
 
   List of named colors
matplotlib.colors.same_color   matplotlib.colors.same_color(c1, c2)[source]
 
Return whether the colors c1 and c2 are the same. c1, c2 can be single colors or lists/arrays of colors.