
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
5K+ Views
To retrieve XY data from a matplotlib figure, we can use get_xdata() and get_ydata() methods.StepsCreate x and y data points using numpy.Limit X and Y axes range, using xlim() and ylim() methods.Plot xs and ys data points using plot() method with marker=diamond, color=red, and markersize=10, store the returned tuple in a line.Use get_xdata() and get_ydata() methods ... Read More

Rishikesh Kumar Rishi
2K+ Views
To let my matplotlib plot go beyond the axes, we can turn off the flag clip_on in the argument of plot() method.StepsCreate xs and ys data points using numpy.Limit the X and Y axis range in the plot to let the line go beyond this limit, using xlim() and ylim() ... Read More

Rishikesh Kumar Rishi
9K+ Views
To avoid overlapping of labels and autopct in a matplotlib pie chart, we can follow label as a legend, using legend() method.StepsInitialize a variable n=20 to get a number of sections in a pie chart.Create slices and activities using numpy.Create random colors using hexadecimal alphabets, in the range of 20.Use pie() method ... Read More

Rishikesh Kumar Rishi
903 Views
To fix colors in scatter plots in matplotlib, we can take the following steps −Create xs and ys random data points using numpy.Create a set of colors using hexadecimal alpabets, equal to the length of ys.Plot the lists, xs and ys, using scatter() method, with the list of colors.To display ... Read More

Rishikesh Kumar Rishi
3K+ Views
To plot two countplot graphs side by side in Seaborn, we can take the following steps −To create two graphs, we can use nrows=1, ncols=2 with figure size (7, 7).Create a dataframe with keys, col1 and col2, using Pandas.Use countplot() to show the counts of observations in each categorical bin ... Read More

Rishikesh Kumar Rishi
1K+ Views
To set transparency based on pixel values in matplotlib, get masked data wherever data is less than certain values. Lesser value will result in full overlapping between two images.StepsCreate data1 and data2 using numpy.Get the masked data using numpy's masked_where() method.Using subplots() method, create a figure and a set of subplots (fig and ax).Display the ... Read More

Rishikesh Kumar Rishi
583 Views
To change the font size of ticks of axes object in matplotlib, we can take the following steps −Create x and y data points using numpy.Using subplots() method, create a figure and a set of subplots (fig and ax).Plot x and y data points using plot() method, with color=red and linewidth=5.Set ... Read More

Rishikesh Kumar Rishi
7K+ Views
To show decimal places and scientific notation on the axis of a matplotlib, we can use scalar formatter by overriding _set_format() method.StepsCreate x and y data points using numpy.Plot x and y using plot() method.Using gca() method, get the current axis.Instantiate the format tick values as a number class, i.e., ScalarFormatter.Set size thresholds ... Read More

Rishikesh Kumar Rishi
8K+ Views
To plot vectors in Python using matplotlib, we can take the following steps −Create a matrix of 2×3 dimension.Create an origin point, from where vecors could be originated.Plot a 3D fields of arrows using quiver() method with origin, data, colors and scale=15.Exampleimport numpy as np from matplotlib import pyplot as plt ... Read More

Rishikesh Kumar Rishi
2K+ Views
To rotate the rectangle patch in a plot, we can use angle in the Rectangle() class to rotate it.StepsCreate a figure and a set of subplots using subplots() method.Add a rectangle on the patch, angle=45°.Add a patch on the axis.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt, patches ... Read More