- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do I print a Celsius symbol with Matplotlib?
To print Celsius symbol with Matplotlib, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Initialize a variable, N.
- Create T and P data points using numpy.
- Plot T and P using plot() method.
- Set the label for the X-axis.
- To display the figure, use show() method.
Example
import matplotlib.pyplot as plt import numpy as np plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True N = 10 T = np.random.rand(N) P = np.random.rand(N) plt.plot(T, P) plt.xlabel("$Temperature {^\circ}C$") plt.show()
Output
- Related Articles
- How do I put a circle with annotation in matplotlib?
- How do I plot a step function with Matplotlib in Python?
- How do I plot only a table in Matplotlib?
- How do I print a double value with full precision using cout in C++?
- How do I get email-id from a MongoDB document and display with print()
- How do I format the axis number format to thousands with a comma in Matplotlib?
- How do I fill a region with only hatch (no background colour) in matplotlib 2.0?
- Matplotlib – How to insert a degree symbol into a Python plot?
- How do I print a Python datetime in the local timezone?
- How do I set color to Rectangle in Matplotlib?
- How do I change the range of the X-axis with datetimes in Matplotlib?
- How do I print a message to the error console using JavaScript?
- How do I get all the bars in a Matplotlib bar chart?
- How do I adjust (offset) the colorbar title in Matplotlib?
- How do I close all the open pyplot windows (Matplotlib)?

Advertisements