MCPcopy
hub / github.com/matplotlib/matplotlib / set_language

Method set_language

lib/matplotlib/text.py:1572–1602  ·  view source on GitHub ↗

Set the language of the text. Parameters ---------- language : str or None The language of the text in a format accepted by libraqm, namely `a BCP47 language code `_. If N

(self, language)

Source from the content-addressed store, hash-verified

1570 return self._language
1571
1572 def set_language(self, language):
1573 """
1574 Set the language of the text.
1575
1576 Parameters
1577 ----------
1578 language : str or None
1579 The language of the text in a format accepted by libraqm, namely `a BCP47
1580 language code <https://www.w3.org/International/articles/language-tags/>`_.
1581
1582 If None, then defaults to :rc:`text.language`.
1583 """
1584 _api.check_isinstance((Sequence, str, None), language=language)
1585 language = mpl._val_or_rc(language, 'text.language')
1586
1587 if not cbook.is_scalar_or_string(language):
1588 language = tuple(language)
1589 for val in language:
1590 if not isinstance(val, tuple) or len(val) != 3:
1591 raise TypeError('language must be list of tuple, not {language!r}')
1592 sublang, start, end = val
1593 if not isinstance(sublang, str):
1594 raise TypeError(
1595 'sub-language specification must be str, not {sublang!r}')
1596 if not isinstance(start, int):
1597 raise TypeError('start location must be int, not {start!r}')
1598 if not isinstance(end, int):
1599 raise TypeError('end location must be int, not {end!r}')
1600
1601 self._language = language
1602 self.stale = True
1603
1604
1605class OffsetFrom:

Callers 2

__init__Method · 0.95
_test_text_languageFunction · 0.80

Calls

no outgoing calls

Tested by 1

_test_text_languageFunction · 0.64