
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
1K+ Views
To create a stacked bar chart, we can use Seaborn's barplot() method, i.e., show point estimates and confidence intervals with bars.Create df using Pandas Data Frame.Using barplot() method, create bar_plot1 and bar_plot2 with color as red and green, and label as count and select.To enable legend, use legend() method, at the upper-right location.To display ... Read More

Rishikesh Kumar Rishi
2K+ Views
To plot a histogram with colors taken from colormap, we can use the setp() method.StepsCreate data points using numpy.Plot data (Step 1) using hist() method, with bins=25, rwidth=.75, ...etc.Returned values n, bins and patches can help to find col.Get a colormap instance for name "RdYlBu".Zip the col and patches.Now, using setp() method, set ... Read More

Rishikesh Kumar Rishi
3K+ Views
We can use the following steps to convert a figure into a numpy array −Read a figure from a directory; convert it into numpy array.Use imshow() method to display the image.Use show() method to display it.Examplefrom matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True im = ... Read More

Rishikesh Kumar Rishi
2K+ Views
To adjust font size in Seaborn, we can take followig steps−Create a dictionary with some mathematical expressionsCreate a dataframe using Pandas data frame.Create a heatmap using heatmap() method.To adjust the font size in Seaborn heatmap, change the fontsize value.To display the figure, use show() method.Exampleimport numpy as np import seaborn ... Read More

Rishikesh Kumar Rishi
994 Views
To draw multiple figures in parallel in Python with matplolib, we can take the following steps−Create random data using numpy.Add a subplot to the current figure, nrows=1, ncols=4 and at index=1.Display data as an image, i.e., on a 2D regular raster, using imshow() method with cmap="Blues_r".Add a subplot to the ... Read More

Rishikesh Kumar Rishi
3K+ Views
To show logarithmically spaced grid lines at all ticks on a log-log plot using matplotlib, we can take the following steps−Create data points for x and y using numpy.Using loglog method, make a plot with log scaling on both the X and Y axis.Use grid() method, lay out a grid ... Read More

Rishikesh Kumar Rishi
645 Views
To set a value for color bar on Seaborn heatmap, we can take following Steps−Create random data using numpy.Use heatmap() method to plot rectangular data as a color-encoded matrix.To display the figure, use show() method.Exampleimport numpy as np import seaborn as sns from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = ... Read More

Rishikesh Kumar Rishi
2K+ Views
To draw arrow heads vectors in 3D matplotlb's plot, we can take the following steps −Create a 2D array, where x, y, z, u, v and w are the coordinates of the arrow locations and direction components of arrow vectors.Using figure() method, create a new figure or activate an existing figure.Add an '~.axes.Axes' to ... Read More

Rishikesh Kumar Rishi
3K+ Views
To remove the X-ticks while keeping the grids, we can take the following steps−Use gca() method to get the current axes, creating one if necessary.Plot the x and np.sin(x) using plot() method with linewidth=5, label y=sin(x).Remove yticks and xticks by passing empty array in the argument of set_xticklabels and set_yticklabels ... Read More

Rishikesh Kumar Rishi
1K+ Views
To plot a transparent histogram with non-transparent edge, we can take the following steps−Create a set of random data points (y).Initialize the number of bins to be drawn.To plot the histogram, we can use hist() method with edge color and facecolor tuplesTo display the figure, use show() method.Exampleimport numpy as ... Read More