
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
432 Views
To set the variable point size in matplotlib, we can take the following steps−Initialize the coordinates of the point.Make a variable to store the point size.Plot the point using scatter method, with marker=o, color=red, s=point_size.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] ... Read More

Rishikesh Kumar Rishi
749 Views
To draw a rectangle over a specific region in a matplotlib graph, 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 facecolor=green.To ... Read More

Rishikesh Kumar Rishi
2K+ Views
To create a draggable legend in matplotlib, we can take the following steps −Create two lines, line1 and line2, using plot() method.Place the legend for plot line1 and line2 with ordered lables at location 1, using legend() method.To create a draggable legend, use set_draggable() method, where state=True. If state=False, then we can't drag ... Read More

Rishikesh Kumar Rishi
2K+ Views
To rescale ylim and xlim automatically, we can take the following steps −To plot a line, use plot() method and data range from 0 to 10.To scale the xlim and ylim automatically, we can make the variable scale_factore=6.Use scale_factor (from Step 2) to rescale the xlim and ylim, using xlim() and ylim() methods, respectively.To display the figure, use ... Read More

Rishikesh Kumar Rishi
6K+ Views
To plot shapely polygons and objects using matplotlib, the steps are as follows −Create a polygon object using (x, y) data points.Get x and y, the exterior data, and the array using polygon.exterior.xy.Plot x and y data points using plot() method with red color.Examplefrom shapely.geometry import Polygon import matplotlib.pyplot as plt ... Read More

Rishikesh Kumar Rishi
539 Views
To plot the lines first and points last, we can take the following Steps −Create xpoints, y1points and y2points using numpy, to draw lines.Plot the curves using the plot() method with x, y1 and y2 points.Draw the scatter points using the scatter method.To display the figure, use the show() method.Exampleimport ... Read More

Rishikesh Kumar Rishi
1K+ Views
To create a stacked lines graph with Python, we can take the following Steps −Create x, y, y1 and y2 points using numpy.Plot the lines using numpy with the above data (Step 1) and labels mentioned.Fill the color between curve y=e^x and y=0, using the fill_between() method.Fill the color between curve y=2x and ... Read More

Rishikesh Kumar Rishi
2K+ Views
It seems difficult to change the projection of an existing axis, but we can take the following steps to create different type projections −Using subplot() method, add a subplot to the current figure, with nrows=1, ncols=3 and current index=1.Add a title to the current axis.Using subplot() method, add a subplot ... Read More

Rishikesh Kumar Rishi
2K+ Views
Whenever plots are saved in .eps/.ps, then the transparency of the plots get lost.To compare them, we can take the following Steps −Create x_data and y_data using numpy.Plot x_data and y_data (Step 1), using the plot() method, with less aplha value, to make it more transparent.Use the grid() method to prove the transparency of ... Read More

Rishikesh Kumar Rishi
9K+ Views
To plot a gradient color line in matplotlib, we can take the following steps −Create x, y and c data points, using numpy.Create scatter points over the axes (closely so as to get a line), using the scatter() method with c and marker='_'.To display the figure, use the show() method.Exampleimport ... Read More