
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 1156 Articles

Rishikesh Kumar Rishi
11K+ Views
plt.figure().close(): Close a figure window.close() by itself closes the current figureclose(h), where h is a Figure instance, closes that figureclose(num) closes the figure with number=numclose(name), where name is a string, closes the figure with that labelclose('all') closes all the figure windowsExamplefrom matplotlib import pyplot as plt fig = plt.figure() ax ... Read More

Rishikesh Kumar Rishi
8K+ Views
To plot a horizontal line on multiple subplots in Python, we can use subplots to get multiple axes and axhline() method to draw a horizontal line.StepsCreate a figure and a set of subplots. Here, we will create 3 subplots.Use axhline() method to draw horizontal lines on each axis.To display the ... Read More

Rishikesh Kumar Rishi
2K+ Views
To overlay an image segmentation with numpy, we can take the following Steps −Make a masked array of 10×10 dimension.Update the masked array with 1 for some region.Make image data using numpy.Mask an array where a condition is met, to get the masked data.Create a new figure or activate an ... Read More

Rishikesh Kumar Rishi
2K+ Views
To limit the number of groups shown in a Seaborn countplot, we can use a variable group_count, used in countplot() method arguments.StepsCreate a figure and two sets of subplots.Create a data frame using Pandas, with two keys.Initalize a variable group_count to limit the group count in countplot() method.Use countplot() method ... Read More

Rishikesh Kumar Rishi
2K+ Views
To plot a probability density function by sample, we can use numpy for x and y data points.StepsCreate x and p data points using numpy.Plot x and p data points using plot() method.Scale X-axis in a range.To display the figure, use show() method.Exampleimport numpy as np from matplotlib import pyplot ... Read More

Rishikesh Kumar Rishi
8K+ 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
712 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
439 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
205 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
696 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