- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 1162 Articles
Rishikesh Kumar Rishi
3K+ 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
387 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
4K+ 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
18K+ 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
3K+ 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
Rishikesh Kumar Rishi
6K+ Views
To shade an area between two points in matplotlib, we can take the following steps−Create x and y data points using numpy.Plot x and y data points, with color=red and linewidth=2.To shade an area parallel to X-axis, initialize two variables, y1 and y2.To add horizontal span across the axes, use ... Read More
Rishikesh Kumar Rishi
3K+ Views
To create a graph with date and time in axis labels, we can take the following steps−Create a figure and add a set of subplots.Create x and y data points using numpy.Set date formatter for X-axis.Plot x and y using plot() method.Set the ticks of X-axis.Set the date-time tick labels ... Read More
Rishikesh Kumar Rishi
11K+ Views
To specify values on Y-axis in Python, we can take the following steps−Create x and y data points using numpy.To specify the value of axes, create a list of characters.Use xticks and yticks method to specify the ticks on the axes with x and y ticks data points respectively.Plot the ... Read More
Rishikesh Kumar Rishi
3K+ Views
To plot 1D data at a given Y-value with pyplot, we can take the following steps−Initialize y value.Create x and y data points using numpy. zeros_like helps to return an array of zeros with the same shape and type as a given array and add y-value for y data points.Plot ... Read More
Rishikesh Kumar Rishi
9K+ Views
To insert a degree symbol into a plot, we can use LaTeX representation.StepsCreate data points for pV, nR and T using numpy.Plot pV and T using plot() method.Set xlabel for pV using xlabel() method.Set the label for temperature with degree symbol using ylabel() method.To display the figure, use show() method.Exampleimport ... Read More