neulab/docprompting-conala huggingface dataset:
get_text_path(prop, s, ismath=False)[source]
 
Convert text s to path (a tuple of vertices and codes for matplotlib.path.Path).  Parameters 
 
propFontProperties


The font properties for the text.  
sstr


The text to be converted.  
ismath{False, True, "TeX"}


If True, use mathtext parser. If "TeX", use tex for rendering.    Returns 
 
vertslist


A list of numpy arrays containing the x and y coordinates of the vertices.  
codeslist


A list of path codes.     Examples Create a list of vertices and codes from a text, and create a Path from those: from matplotlib.path import Path
from matplotlib.textpath import TextToPath
from matplotlib.font_manager import FontProperties

fp = FontProperties(family="Humor Sans", style="italic")
verts, codes = TextToPath().get_text_path(fp, "ABC")
path = Path(verts, codes, closed=False)
 Also see TextPath for a more direct way to create a path from a text.
classmatplotlib.ticker.AutoLocator[source]
 
Bases: matplotlib.ticker.MaxNLocator Dynamically find major tick positions. This is actually a subclass of MaxNLocator, with parameters nbins = 'auto' and steps = [1, 2, 2.5, 5, 10]. To know the values of the non-public parameters, please have a look to the defaults of MaxNLocator.
classmatplotlib.ticker.AutoMinorLocator(n=None)[source]
 
Bases: matplotlib.ticker.Locator Dynamically find minor tick positions based on the positions of major ticks. The scale must be linear with major ticks evenly spaced. n is the number of subdivisions of the interval between major ticks; e.g., n=2 will place a single minor tick midway between major ticks. If n is omitted or None, it will be set to 5 or 4.   tick_values(vmin, vmax)[source]
 
Return the values of the located ticks given vmin and vmax.  Note To get tick locations with the vmin and vmax values defined automatically for the associated axis simply call the Locator instance: >>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
classmatplotlib.ticker.EngFormatter(unit='', places=None, sep=' ', *, usetex=None, useMathText=None)[source]
 
Bases: matplotlib.ticker.Formatter Format axis values using engineering prefixes to represent powers of 1000, plus a specified unit, e.g., 10 MHz instead of 1e7.  Parameters 
 
unitstr, default: ""


Unit symbol to use, suitable for use with single-letter representations of powers of 1000. For example, 'Hz' or 'm'.  
placesint, default: None


Precision with which to display the number, specified in digits after the decimal point (there will be between one and three digits before the decimal point). If it is None, the formatting falls back to the floating point format '%g', which displays up to 6 significant digits, i.e. the equivalent value for places varies between 0 and 5 (inclusive).  
sepstr, default: " "


Separator used between the value and the prefix/unit. For example, one get '3.14 mV' if sep is " " (default) and '3.14mV' if sep is "". Besides the default behavior, some other useful options may be:  
sep="" to append directly the prefix/unit to the value; 
sep="\N{THIN SPACE}" (U+2009); 
sep="\N{NARROW NO-BREAK SPACE}" (U+202F); 
sep="\N{NO-BREAK SPACE}" (U+00A0).   
usetexbool, default: rcParams["text.usetex"] (default: False)


To enable/disable the use of TeX's math mode for rendering the numbers in the formatter.  
useMathTextbool, default: rcParams["axes.formatter.use_mathtext"] (default: False)


To enable/disable the use mathtext for rendering the numbers in the formatter.       ENG_PREFIXES={-24: 'y', -21: 'z', -18: 'a', -15: 'f', -12: 'p', -9: 'n', -6: 'µ', -3: 'm', 0: '', 3: 'k', 6: 'M', 9: 'G', 12: 'T', 15: 'P', 18: 'E', 21: 'Z', 24: 'Y'}

   format_eng(num)[source]
 
Format a number in engineering notation, appending a letter representing the power of 1000 of the original number. Some examples: >>> format_eng(0)       # for self.places = 0
'0'
 >>> format_eng(1000000) # for self.places = 1
'1.0 M'
 >>> format_eng("-1e-6") # for self.places = 2
'-1.00 µ'
 
   get_useMathText()[source]

   get_usetex()[source]

   set_useMathText(val)[source]

   set_usetex(val)[source]

   propertyuseMathText

   propertyusetex
ENG_PREFIXES={-24: 'y', -21: 'z', -18: 'a', -15: 'f', -12: 'p', -9: 'n', -6: 'µ', -3: 'm', 0: '', 3: 'k', 6: 'M', 9: 'G', 12: 'T', 15: 'P', 18: 'E', 21: 'Z', 24: 'Y'}
format_eng(num)[source]
 
Format a number in engineering notation, appending a letter representing the power of 1000 of the original number. Some examples: >>> format_eng(0)       # for self.places = 0
'0'
 >>> format_eng(1000000) # for self.places = 1
'1.0 M'
 >>> format_eng("-1e-6") # for self.places = 2
'-1.00 µ'
classmatplotlib.ticker.FixedFormatter(seq)[source]
 
Bases: matplotlib.ticker.Formatter Return fixed strings for tick labels based only on position, not value.  Note FixedFormatter should only be used together with FixedLocator. Otherwise, the labels may end up in unexpected positions.  Set the sequence seq of strings that will be used for labels.   get_offset()[source]

   set_offset_string(ofs)[source]
classmatplotlib.ticker.FixedLocator(locs, nbins=None)[source]
 
Bases: matplotlib.ticker.Locator Tick locations are fixed. If nbins is not None, the array of possible positions will be subsampled to keep the number of ticks <= nbins +1. The subsampling will be done so as to include the smallest absolute value; for example, if zero is included in the array of possibilities, then it is guaranteed to be one of the chosen ticks.   set_params(nbins=None)[source]
 
Set parameters within this locator. 
   tick_values(vmin, vmax)[source]
 
Return the locations of the ticks.  Note Because the values are fixed, vmin and vmax are not used in this method.
set_params(nbins=None)[source]
 
Set parameters within this locator.
tick_values(vmin, vmax)[source]
 
Return the locations of the ticks.  Note Because the values are fixed, vmin and vmax are not used in this method.
classmatplotlib.ticker.FormatStrFormatter(fmt)[source]
 
Bases: matplotlib.ticker.Formatter Use an old-style ('%' operator) format string to format the tick. The format string should have a single variable format (%) in it. It will be applied to the value (not the position) of the tick. Negative numeric values will use a dash not a unicode minus, use mathtext to get a unicode minus by wrappping the format specifier with $ (e.g. "$%g$").
classmatplotlib.ticker.Formatter[source]
 
Bases: matplotlib.ticker.TickHelper Create a string based on a tick value and location.   staticfix_minus(s)[source]
 
Some classes may want to replace a hyphen for minus with the proper unicode symbol (U+2212) for typographical correctness. This is a helper method to perform such a replacement when it is enabled via rcParams["axes.unicode_minus"] (default: True). 
   format_data(value)[source]
 
Return the full string representation of the value with the position unspecified. 
   format_data_short(value)[source]
 
Return a short string version of the tick value. Defaults to the position-independent long value. 
   format_ticks(values)[source]
 
Return the tick labels for all the ticks at once. 
   get_offset()[source]

   locs=[]

   set_locs(locs)[source]
 
Set the locations of the ticks. This method is called before computing the tick labels because some formatters need to know all tick locations to do so.
staticfix_minus(s)[source]
 
Some classes may want to replace a hyphen for minus with the proper unicode symbol (U+2212) for typographical correctness. This is a helper method to perform such a replacement when it is enabled via rcParams["axes.unicode_minus"] (default: True).
format_data(value)[source]
 
Return the full string representation of the value with the position unspecified.
set_locs(locs)[source]
 
Set the locations of the ticks. This method is called before computing the tick labels because some formatters need to know all tick locations to do so.
classmatplotlib.ticker.FuncFormatter(func)[source]
 
Bases: matplotlib.ticker.Formatter Use a user-defined function for formatting. The function should take in two inputs (a tick value x and a position pos), and return a string containing the corresponding tick label.   get_offset()[source]

   set_offset_string(ofs)[source]
classmatplotlib.ticker.IndexLocator(base, offset)[source]
 
Bases: matplotlib.ticker.Locator Place a tick on every multiple of some base number of points plotted, e.g., on every 5th point. It is assumed that you are doing index plotting; i.e., the axis is 0, len(data). This is mainly useful for x ticks. Place ticks every base data point, starting at offset.   set_params(base=None, offset=None)[source]
 
Set parameters within this locator 
   tick_values(vmin, vmax)[source]
 
Return the values of the located ticks given vmin and vmax.  Note To get tick locations with the vmin and vmax values defined automatically for the associated axis simply call the Locator instance: >>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
set_params(base=None, offset=None)[source]
 
Set parameters within this locator
classmatplotlib.ticker.LinearLocator(numticks=None, presets=None)[source]
 
Bases: matplotlib.ticker.Locator Determine the tick locations The first time this function is called it will try to set the number of ticks to make a nice tick partitioning. Thereafter the number of ticks will be fixed so that interactive navigation will be nice Use presets to set locs based on lom. A dict mapping vmin, vmax->locs   propertynumticks

   set_params(numticks=None, presets=None)[source]
 
Set parameters within this locator. 
   tick_values(vmin, vmax)[source]
 
Return the values of the located ticks given vmin and vmax.  Note To get tick locations with the vmin and vmax values defined automatically for the associated axis simply call the Locator instance: >>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
  
   view_limits(vmin, vmax)[source]
 
Try to choose the view limits intelligently.
set_params(numticks=None, presets=None)[source]
 
Set parameters within this locator.
view_limits(vmin, vmax)[source]
 
Try to choose the view limits intelligently.
classmatplotlib.ticker.Locator[source]
 
Bases: matplotlib.ticker.TickHelper Determine the tick locations; Note that the same locator should not be used across multiple Axis because the locator stores references to the Axis data and view limits.   MAXTICKS=1000

   nonsingular(v0, v1)[source]
 
Adjust a range as needed to avoid singularities. This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.  If v0 == v1 (possibly up to some floating point slop), this method returns an expanded interval around this value. If (v0, v1) == (-inf, +inf), this method returns appropriate default view limits. Otherwise, (v0, v1) is returned without modification.  
   raise_if_exceeds(locs)[source]
 
Log at WARNING level if locs is longer than Locator.MAXTICKS. This is intended to be called immediately before returning locs from __call__ to inform users in case their Locator returns a huge number of ticks, causing Matplotlib to run out of memory. The "strange" name of this method dates back to when it would raise an exception instead of emitting a log. 
   set_params(**kwargs)[source]
 
Do nothing, and raise a warning. Any locator class not supporting the set_params() function will call this. 
   tick_values(vmin, vmax)[source]
 
Return the values of the located ticks given vmin and vmax.  Note To get tick locations with the vmin and vmax values defined automatically for the associated axis simply call the Locator instance: >>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
  
   view_limits(vmin, vmax)[source]
 
Select a scale for the range from vmin to vmax. Subclasses should override this method to change locator behaviour.
nonsingular(v0, v1)[source]
 
Adjust a range as needed to avoid singularities. This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.  If v0 == v1 (possibly up to some floating point slop), this method returns an expanded interval around this value. If (v0, v1) == (-inf, +inf), this method returns appropriate default view limits. Otherwise, (v0, v1) is returned without modification.
raise_if_exceeds(locs)[source]
 
Log at WARNING level if locs is longer than Locator.MAXTICKS. This is intended to be called immediately before returning locs from __call__ to inform users in case their Locator returns a huge number of ticks, causing Matplotlib to run out of memory. The "strange" name of this method dates back to when it would raise an exception instead of emitting a log.
set_params(**kwargs)[source]
 
Do nothing, and raise a warning. Any locator class not supporting the set_params() function will call this.
classmatplotlib.ticker.LogFormatter(base=10.0, labelOnlyBase=False, minor_thresholds=None, linthresh=None)[source]
 
Bases: matplotlib.ticker.Formatter Base class for formatting ticks on a log or symlog scale. It may be instantiated directly, or subclassed.  Parameters 
 
basefloat, default: 10.


Base of the logarithm used in all calculations.  
labelOnlyBasebool, default: False


If True, label ticks only at integer powers of base. This is normally True for major ticks and False for minor ticks.  
minor_thresholds(subset, all), default: (1, 0.4)


If labelOnlyBase is False, these two numbers control the labeling of ticks that are not at integer powers of base; normally these are the minor ticks. The controlling parameter is the log of the axis data range. In the typical case where base is 10 it is the number of decades spanned by the axis, so we can call it 'numdec'. If numdec <= all, all minor ticks will be labeled. If all < numdec <= subset, then only a subset of minor ticks will be labeled, so as to avoid crowding. If numdec > subset then no minor ticks will be labeled.  
linthreshNone or float, default: None


If a symmetric log scale is in use, its linthresh parameter must be supplied here.     Notes The set_locs method must be called to enable the subsetting logic controlled by the minor_thresholds parameter. In some cases such as the colorbar, there is no distinction between major and minor ticks; the tick locations might be set manually, or by a locator that puts ticks at integer powers of base and at intermediate locations. For this situation, disable the minor_thresholds logic by using minor_thresholds=(np.inf, np.inf), so that all ticks will be labeled. To disable labeling of minor ticks when 'labelOnlyBase' is False, use minor_thresholds=(0, 0). This is the default for the "classic" style. Examples To label a subset of minor ticks when the view limits span up to 2 decades, and all of the ticks when zoomed in to 0.5 decades or less, use minor_thresholds=(2, 0.5). To label all minor ticks when the view limits span up to 1.5 decades, use minor_thresholds=(1.5, 1.5).   base(base)[source]
 
Change the base for labeling.  Warning Should always match the base used for LogLocator  
   format_data(value)[source]
 
Return the full string representation of the value with the position unspecified. 
   format_data_short(value)[source]
 
Return a short string version of the tick value. Defaults to the position-independent long value. 
   label_minor(labelOnlyBase)[source]
 
Switch minor tick labeling on or off.  Parameters 
 
labelOnlyBasebool


If True, label ticks only at integer powers of base.     
   set_locs(locs=None)[source]
 
Use axis view limits to control which ticks are labeled. The locs parameter is ignored in the present algorithm.
base(base)[source]
 
Change the base for labeling.  Warning Should always match the base used for LogLocator
label_minor(labelOnlyBase)[source]
 
Switch minor tick labeling on or off.  Parameters 
 
labelOnlyBasebool


If True, label ticks only at integer powers of base.
set_locs(locs=None)[source]
 
Use axis view limits to control which ticks are labeled. The locs parameter is ignored in the present algorithm.
classmatplotlib.ticker.LogFormatterExponent(base=10.0, labelOnlyBase=False, minor_thresholds=None, linthresh=None)[source]
 
Bases: matplotlib.ticker.LogFormatter Format values for log axis using exponent = log_base(value).
classmatplotlib.ticker.LogFormatterMathtext(base=10.0, labelOnlyBase=False, minor_thresholds=None, linthresh=None)[source]
 
Bases: matplotlib.ticker.LogFormatter Format values for log axis using exponent = log_base(value).
classmatplotlib.ticker.LogFormatterSciNotation(base=10.0, labelOnlyBase=False, minor_thresholds=None, linthresh=None)[source]
 
Bases: matplotlib.ticker.LogFormatterMathtext Format values following scientific notation in a logarithmic axis.
classmatplotlib.ticker.LogitFormatter(*, use_overline=False, one_half='\x0crac{1}{2}', minor=False, minor_threshold=25, minor_number=6)[source]
 
Bases: matplotlib.ticker.Formatter Probability formatter (using Math text).  Parameters 
 
use_overlinebool, default: False


If x > 1/2, with x = 1-v, indicate if x should be displayed as $overline{v}$. The default is to display $1-v$.  
one_halfstr, default: r"frac{1}{2}"


The string used to represent 1/2.  
minorbool, default: False


Indicate if the formatter is formatting minor ticks or not. Basically minor ticks are not labelled, except when only few ticks are provided, ticks with most space with neighbor ticks are labelled. See other parameters to change the default behavior.  
minor_thresholdint, default: 25


Maximum number of locs for labelling some minor ticks. This parameter have no effect if minor is False.  
minor_numberint, default: 6


Number of ticks which are labelled when the number of ticks is below the threshold.       format_data_short(value)[source]
 
Return a short string version of the tick value. Defaults to the position-independent long value. 
   set_locs(locs)[source]
 
Set the locations of the ticks. This method is called before computing the tick labels because some formatters need to know all tick locations to do so. 
   set_minor_number(minor_number)[source]
 
Set the number of minor ticks to label when some minor ticks are labelled.  Parameters 
 
minor_numberint


Number of ticks which are labelled when the number of ticks is below the threshold.     
   set_minor_threshold(minor_threshold)[source]
 
Set the threshold for labelling minors ticks.  Parameters 
 
minor_thresholdint


Maximum number of locations for labelling some minor ticks. This parameter have no effect if minor is False.     
   set_one_half(one_half)[source]
 
Set the way one half is displayed.  one_halfstr, default: r"frac{1}{2}"


The string used to represent 1/2.   
   use_overline(use_overline)[source]
 
Switch display mode with overline for labelling p>1/2.  Parameters 
 
use_overlinebool, default: False


If x > 1/2, with x = 1-v, indicate if x should be displayed as $overline{v}$. The default is to display $1-v$.
set_minor_number(minor_number)[source]
 
Set the number of minor ticks to label when some minor ticks are labelled.  Parameters 
 
minor_numberint


Number of ticks which are labelled when the number of ticks is below the threshold.
set_minor_threshold(minor_threshold)[source]
 
Set the threshold for labelling minors ticks.  Parameters 
 
minor_thresholdint


Maximum number of locations for labelling some minor ticks. This parameter have no effect if minor is False.
set_one_half(one_half)[source]
 
Set the way one half is displayed.  one_halfstr, default: r"frac{1}{2}"


The string used to represent 1/2.
use_overline(use_overline)[source]
 
Switch display mode with overline for labelling p>1/2.  Parameters 
 
use_overlinebool, default: False


If x > 1/2, with x = 1-v, indicate if x should be displayed as $overline{v}$. The default is to display $1-v$.
classmatplotlib.ticker.LogitLocator(minor=False, *, nbins='auto')[source]
 
Bases: matplotlib.ticker.MaxNLocator Determine the tick locations for logit axes Place ticks on the logit locations  Parameters 
 
nbinsint or 'auto', optional


Number of ticks. Only used if minor is False.  
minorbool, default: False


Indicate if this locator is for minor ticks or not.       propertyminor

   nonsingular(vmin, vmax)[source]
 
Adjust a range as needed to avoid singularities. This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.  If v0 == v1 (possibly up to some floating point slop), this method returns an expanded interval around this value. If (v0, v1) == (-inf, +inf), this method returns appropriate default view limits. Otherwise, (v0, v1) is returned without modification.  
   set_params(minor=None, **kwargs)[source]
 
Set parameters within this locator. 
   tick_values(vmin, vmax)[source]
 
Return the values of the located ticks given vmin and vmax.  Note To get tick locations with the vmin and vmax values defined automatically for the associated axis simply call the Locator instance: >>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
set_params(minor=None, **kwargs)[source]
 
Set parameters within this locator.
classmatplotlib.ticker.LogLocator(base=10.0, subs=(1.0,), numdecs=4, numticks=None)[source]
 
Bases: matplotlib.ticker.Locator Determine the tick locations for log axes Place ticks on the locations : subs[j] * base**i  Parameters 
 
basefloat, default: 10.0


The base of the log used, so ticks are placed at base**n.  
subsNone or str or sequence of float, default: (1.0,)


Gives the multiples of integer powers of the base at which to place ticks. The default places ticks only at integer powers of the base. The permitted string values are 'auto' and 'all', both of which use an algorithm based on the axis view limits to determine whether and how to put ticks between integer powers of the base. With 'auto', ticks are placed only between integer powers; with 'all', the integer powers are included. A value of None is equivalent to 'auto'.  
numticksNone or int, default: None


The maximum number of ticks to allow on a given axis. The default of None will try to choose intelligently as long as this Locator has already been assigned to an axis using get_tick_space, but otherwise falls back to 9.       base(base)[source]
 
Set the log base (major tick every base**i, i integer). 
   nonsingular(vmin, vmax)[source]
 
Adjust a range as needed to avoid singularities. This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.  If v0 == v1 (possibly up to some floating point slop), this method returns an expanded interval around this value. If (v0, v1) == (-inf, +inf), this method returns appropriate default view limits. Otherwise, (v0, v1) is returned without modification.  
   set_params(base=None, subs=None, numdecs=None, numticks=None)[source]
 
Set parameters within this locator. 
   subs(subs)[source]
 
Set the minor ticks for the log scaling every base**i*subs[j]. 
   tick_values(vmin, vmax)[source]
 
Return the values of the located ticks given vmin and vmax.  Note To get tick locations with the vmin and vmax values defined automatically for the associated axis simply call the Locator instance: >>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
  
   view_limits(vmin, vmax)[source]
 
Try to choose the view limits intelligently.
base(base)[source]
 
Set the log base (major tick every base**i, i integer).
set_params(base=None, subs=None, numdecs=None, numticks=None)[source]
 
Set parameters within this locator.
subs(subs)[source]
 
Set the minor ticks for the log scaling every base**i*subs[j].