- 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
Rishikesh Kumar Rishi has Published 1162 Articles
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
7K+ Views
To plot a 2D matrix in Python with colorbar, we can use numpy to create a 2D array matrix and use that matrix in the imshow() method.StepsCreate data2D using numpy.Use imshow() method to display data as an image, i.e., on a 2D regular raster.Create a colorbar for a ScalarMappable instance ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
540 Views
To retrieve colorbar instance from figure in matplotlib, we can use imshow scalar mappable object in colorbar to retrieve colorbar instance.StepsGet random data with 10×10 dimension of array, data points between -1 to 1.Use imshow() method to display data as an image, i.e., on a 2D regular raster.Create a colorbar ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
279 Views
To rotate axis text for each subplot, we can use text with rotation in the argument.StepsCreate a new figure or activate an existing figure.Add an '~.axes.Axes' to the figure as part of a subplot arrangement using add_subplot() method.Adjust the subplot layout parameters using subplots_adjust() method.Add a centered title to the ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
145 Views
To layer a contourf plot and surface_plot in matplotlib, we can take the following Steps −Initialize the variables, delta, xrange, yrange, x and y using numpy.Create a new figure or activate an existing figure using figure() method.Get the current axis where projection='3d'.Create a 3d countour plot with x and y ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
565 Views
To make a heatmap square in Seaborn facetgrid, we cn use heatmap() method with 10×10 random data set.StepsCreate a random data of size 10×10, with minimum -1 and maximum 10.Plot rectangular data as a color-encoded matrix using heatmap() method with data and color map "twilight_r".To display the figure, use show() ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
12K+ Views
To plot points on the surface of a sphere in Python, we can use plot_surface() method.StepsCreate a new figure or activate an existing figure using figure() method.Add a set of subplots using add_subplot() method with 3d projection.Initialize a variable, r.Get the theta value for spherical points and x, y, and ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
17K+ Views
To create a 3D plot from a 3D numpy array, we can create a 3D array using numpy and extract the x, y, and z points.Create a new figure or activate an existing figure using figure() method.Add an '~.axes.Axes' to the figure as part of a subplot arrangement using add_subplot() ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
579 Views
To animate a contour plot in matplotlib in Python, we can take the following steps−Create a random data of shape 10☓10 dimension.Create a figure and a set of subplots using subplots() method.Makes an animation by repeatedly calling a function *func* using FuncAnimation() class.To update the contour value in a function, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
1K+ Views
To position and align a matplotlib figure legend, we can take the following steps−Plot line1 and line2 using plot() method.Place a legend on the figure. Use bbox_to_anchor to set the position and make horizontal alignment of the legend elements.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
To convert numbers to a color scale in matplotlib, we can take the following steps.StepsCreate x, y and c data points using numpy.Convert the data points to Pandas dataframe.Create a new figure or activate an existing figure using subplots() method.Get the hot colormap.To linearly normalize the data, we can use ... Read More