Open In App

Matplotlib.axes.Axes.set_fc() in Python

Last Updated : 12 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report
Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.

matplotlib.axes.Axes.set_fc() Function

The Axes.set_fc() function in axes module of matplotlib library is used to set the facecolor of the Axes.
Syntax: Axes.set_fc(self, color) Parameters: This method accept only one parameters. color: This parameter accepts the color for the facecolor of the axes. Returns:This method does not returns any value.
Below examples illustrate the matplotlib.axes.Axes.set_fc() function in matplotlib.axes: Example 1: Python3
# Implementation of matplotlib function 
import matplotlib.pyplot as plt
import numpy as np
   
fig, ax = plt.subplots()

ax.set_fc('# B6ABF0')
ax.set_xlabel('x-axis')
ax.set_ylabel('y-axis')
ax.plot([1, 2, 3], color ="black")

ax.set_title('matplotlib.axes.Axes.set_fc()\
 Example\n', fontsize = 12, fontweight ='bold')
plt.show()
Output: Example 2: Python3
# Implementation of matplotlib function
import numpy as np
import matplotlib.pyplot as plt
   
t = np.linspace(0.0, 2.0, 201)
s = np.sin(2 * np.pi * t)

fig, ax = plt.subplots()
ax.set_fc('# 339E17')
ax.set_xlabel('x-axis')
ax.set_ylabel('y-axis')
ax.plot(t, s, )
ax.set_title('matplotlib.axes.Axes.set_fc()\
 Example\n', fontsize = 12, fontweight ='bold')
plt.show()
Output:

Article Tags :
Practice Tags :

Similar Reads

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy