- 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](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
744 Views
Using matplotlib.get_backend(), we can get the backend value.StepsImport matplotlib.To return the name of the current backend, use the get_backend() method.Exampleimport matplotlib print("Backend used by matplotlib is: ", matplotlib.get_backend())OutputBackend used by matplotlib is: GTK3Agg
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
We can iterate a plot using display.clear_output(wait=True), display.display(pl.gcf()) and time.sleep() methods in a loop to get the exact output.StepsPlot a sample (or samples) from the "standard normal" distribution using pylab.randn().Clear the output of the current cell receiving output, wait=False(default value), wait to clear the output until new output is available ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
385 Views
First, we can create an image using imshow method, taking a harvest matrix. After that, we can mark those image pixels with some value.StepsCreate a list of subjects.Create a list of students.Create a harvest matrix.Create fig and ax variables using subplots method, where default nrows and ncols are 1.Display data ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
776 Views
Using imshow method, we can create an image with an input (5, 5) array dimension. After that, we can use the xticks and yticks method to mark the ticks on the axes.StepsReturn random floats in the half-open interval [5, 5) and interpolation='nearest'.Display data as an image, i.e., on a 2D ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
7K+ Views
Using plt.xticks(x, labels, rotation='vertical'), we can rotate our tick’s label.StepsCreate two lists, x, and y.Create labels with a list of different cities.Adjust the subplot layout parameters, where bottom = 0.15.Add a subplot to the current figure, where nrow = 1, ncols = 2 and index = 1.Plot the line using ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
6K+ Views
Using plt.colorbar(ticks=np.linspace(-2, 2, 5)), we can create a discrete color bar.StepsReturn random floats in the half open interval, i.e., x, using np.random.random method.Return random floats in the half open interval, i.e., y, using np.random.random method.Return random integers from `low` (inclusive) to `high` (exclusive), i.e., z, using np.random.randint(-2, 3, 20) method.Set ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
3K+ Views
Using plt.get_current_fig_manager() and mng.full_screen_toggle() methods, we can maximise a plot.StepsAdd a subplot to the current figure, where nrow = 1, ncols = 1 and index = 1.Create a pie chart using list [1, 2, 3] and pie() method.Return the figure manager of the current figure, using get_current_fig_manager() method. The figure ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
First, we can create two axes using the subplot method where nrows=2, ncols=1. That means, we can have two indices to plot the desired plot. We can use ax1.get_shared_x_axes().join(ax1, ax2) method for our plot.StepsCreate two lists of the numbers.Add a subplot to the current figure, ax1, where nrows = 2, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
21K+ Views
In this program, we can initialize some input values and then try to plot a bar using those values. We can instantiate a figure and axis so that we could set the label, ticks, and annotate the height and width of the bar.StepsMake a list of years.Make a list of ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
822 Views
Log helps to make a plot with log scaling on both the X and Y axis, whereas symlog (symmetric log) is used for axis scaling.StepsFirst, we can adjust the subplot layout parameters.Return an evenly spaced value (t) within a given interval, using the numpy.arrange() method.Add a subplot to the current ... Read More