
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
3K+ Views
To plot a histogram with Y-axis as percentage in matplotlib, we can take the following steps −Create a list of numbers as y.Create a number of bins.Plot a histogram using hist() method, where y, bins, and edgecolor are passed in the argument.Store the patches to set the percentage on Y-axis.Create a list ... Read More

Rishikesh Kumar Rishi
6K+ Views
To set Y-Axis in matplotlib using Pandas, we can take the following steps −Create a dictionary with the keys, x and y.Create a data frame using Pandas.Plot data points using Pandas plot, with ylim(0, 25) and xlim(0, 15).To display the figure, use show() method.Exampleimport numpy as np import pandas as pd from ... Read More

Rishikesh Kumar Rishi
1K+ Views
To remove the outline of a circle marker, we can reduce the value of marker edge width.Initialize list for x and y, with a single value.Limit x and y axis range for 0 to 5.Lay out a grid in current line style.Plot the given x and y using plot() method, with marker="o", markeredgecolor="red", markerfacecolor="green" and ... Read More

Rishikesh Kumar Rishi
3K+ Views
To use extent in matplotlib imshow(), 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 ... Read More

Rishikesh Kumar Rishi
2K+ Views
To plot a Venn diagram, first install Venn diagram using command "pip install matplotlib-venn". Using venn3, plot a 3-set area-weighted Venn diagram.StepsCreate 3 sets.Using venn3, make a Venn diagram.To display the figure, use show() method.Exampleimport matplotlib.pyplot as plt from matplotlib_venn import venn3 plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True set1 = {'A', ... Read More

Rishikesh Kumar Rishi
1K+ Views
To imporove the label placement for matplotlib scatter chart, we can first plot the scatter points and annotate those points with labels.StepsCreate points for x and y using numpy.Create labels using xpoints.Use scatter() method to scatter points.Iterate the labels, xpoints and ypoints and annotate the plot with label, x and y with different properties.To ... Read More

Rishikesh Kumar Rishi
2K+ Views
To plot bar graphs with same X coordinates (G1, G2, G3, G4 and G5), side by side in matplotlib, we can take the following steps −Create the following lists – labels, men_means and women_means with different data elements.Return evenly spaced values within a given interval, using numpy.arrange() method.Set the width variable, ... Read More

Rishikesh Kumar Rishi
601 Views
To plot scatter points using plot method in matplotlib, we can take the following steps−Create random data points (x1 and x2) using numpy.Plot x1 data points using plot() method with marker size 20 and green color.Plot x2 data points using plot() method with marker size 10 and red color.Exampleimport numpy ... Read More

Rishikesh Kumar Rishi
7K+ Views
To change the formatting of a datetime axis in matplotlib, we can take the following steps−Create a dataframe df using pandas DataFrame with time and speed as keysCreate a figure and a set of subplots using subplots() method.Plot the dataframe using plot method, with df's (Step 1) time and speed.To ... Read More

Rishikesh Kumar Rishi
5K+ Views
To save a figure as a file from iPython, we can take the following steps−Create a new figure or activate an existing figure.Add an axes to the figure using add_axes() method.Plot the given list.Save the plot using savefig() method.Examplefrom matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = ... Read More