
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
7K+ Views
To add percentages on top of bars in Seaborn, we can take the following steps −Create the lists, x, y and percentages to plot using Seaborn.Using barplot, show point estimates and confidence intervals with bars. Store the returned axis.Find patches from the returned axis (In step 2).Iterate the patches (returned in ... Read More

Rishikesh Kumar Rishi
909 Views
To decouple hatch and edge color in matplotlib, we can use hatch color “o” and edge color “red”.−StepsCreate a new figure or activate existing figure.Add a subplot arrangement to the current axes.Create two lists of data points.Use bar() method with hatch and edgecolor.To display the figure, use show() method.Exampleimport matplotlib.pyplot ... Read More

Rishikesh Kumar Rishi
766 Views
To fix the extension of margin at the bottom of a figure, we can take the following steps −Using Pandas dataframe, create a df with the keys, time and speed.Plot df.time and df.speed using plot() method.Tick_params() is a convenience method for changing the appearance of ticks and tick labels. rotation=90 extends the tick ... Read More

Rishikesh Kumar Rishi
2K+ Views
To set the background color on specific areas of a pyplot, we can take the following steps −Using subplots() method, create a figure and a set of subplots, where nrows=1.Using rectangle, we can create a rectangle, defined via an anchor point and its width and height. Where, edgecolor=orange, linewidth=7, and ... Read More

Rishikesh Kumar Rishi
10K+ Views
To set the xlabel at the end of X-axis in matplotlib, we can take the following steps −Create data points for x using numpy.Using subplot() method, add a subplot to the current figure.Plot x and log(x) using plot() method.Set the label on X-axis using set_label() method, with fontsize=16, loc=left, and color=red.To set the xlabel at the end ... Read More

Rishikesh Kumar Rishi
4K+ Views
To draw axis in the middle of a figure, we can take the following steps −Create x and sqr data points using numpy.Create a new figure, or activate an existing figure, using figure() method.Add an axis to the figure as a part of a subplot arrangement.Set the postion of left and bottom ... Read More

Rishikesh Kumar Rishi
475 Views
If a 4-tuple or B box Base is given, then it specifies the b box (x, y, width, height) that the legend is placed in.StepsCreate x and y data points using numpy.Plot x and y using plot() method, with label y=sin(x) and color=green.To place the legend at a specific location, ... Read More

Rishikesh Kumar Rishi
5K+ Views
To make the angles in a matplotlib polar plot go clockwise with 00 at the top, we can take the followingsteps−StepsAdd a subplot to the current figure ax.To set polar plot clockwise with top 0o, set the theta direction as −1 using set_theta_direction()method. And, use set_theta_offset() method to set the ... Read More

Rishikesh Kumar Rishi
20K+ Views
To plot over an image background, we can take the following steps−Read an image from a file into an array.Create a figure (fig) and add a set of subplots (ax) with extent [0, 300, 0, 300].Create an array x of range (300).Plot x using plot() method with linestyle=dotted, linewidth=2, and ... Read More

Rishikesh Kumar Rishi
4K+ Views
To make equivalent imagesc, we can use extent [left, right, bottom, top].StepsCreate random data using numpy.Display the data as an image, i.e., on a 2D regular raster, with data and extent [−1, 1, −1, 1] arguments.To display the figure, use show() method.Exampleimport numpy as np from matplotlib import pyplot as ... Read More