![]() |
VOOZH | about |
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Artist class contains Abstract base class for objects that render into a FigureCanvas. All visible elements in a figure are subclasses of Artist.
The set_label() method in artist module of matplotlib library is used to set the label that will be displayed in the legend.
Syntax: Artist.set_label(self, s)
Parameters: This method accepts only one parameters.
- s: This parameter is converted to a string by calling str.
Returns: This method does not return any value.
Below examples illustrate the matplotlib.artist.Artist.set_label() function in matplotlib:
Example 1:
Output:
👁 ImageExample 2: