# Python | Adding Sigma in Plot Label

In this article, we are going to learn how to add 𝜎 (sigma) letter in the plot label in Python?
Submitted by Anuj Singh, on July 18, 2020

Sigma (𝜎) is very often used greek mathematical letters and has a higher repetition in probability. In this article, we are going to add 𝜎 using a command in matplotlib.

plt.text(3, 0.4, r'$\sigma=100$')


plt.title('Errorbar with 'r'$\sigma=100$')
#Adding 𝜎 in title of the figure


plt.xlabel('Time ('r'$\sigma=100)$')
#Adding 𝜎 in title of the figure


plt.ylabel('Variation ('r'$\sigma=100)$')
#Adding 𝜎 in title of the figure


## Python code for adding omega in plot label

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(0.1, 5, 0.1)
y = np.sin(x)*np.exp(-x)

# In text
plt.figure()
plt.plot(x,y, 'o', color='purple')
plt.title('Errorbar')
plt.text(4, 0.0, r'$\sigma=100$')
plt.grid()
plt.show()

# In title
plt.figure()
plt.plot(x,y, 'o', color='purple')
plt.title('Plotting with 'r'$\sigma=100$')
plt.grid()
plt.show()

# In x-axis label
plt.figure()
plt.plot(x,y, 'o', color='purple')
plt.xlabel('Time ('r'$\sigma=100)$')
plt.grid()
plt.show()

# In y-axis label
plt.figure()
plt.plot(x,y, 'o', color='purple')
plt.ylabel('Function ('r'$\sigma=100)$')
plt.grid()
plt.show()


Output:

Output is as figure


Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates