- 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
4K+ Views
To make the marker face color transparent without making the line transparent in matplotlib, we can take the following steps −Create x_data and y_data(sin(x_data)), using numpy.Plot curve using x_data and y_data, with marker style and marker size. By changing the alpha, we can make it transparent to opaque.To get the essence of ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
769 Views
To extract a subset of a colormap as a new colormap, we can take the following steps −Create a random array with 10×10 shape.Add a subplot to the current figure, where nrows=1, ncols=2 and index=1.Initialize using get_cmap so that scatter knows.Using imshow() method with colormap, display the data as an image, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
To define a discrete colormap for imshow in matplotlib, we can take following the steps −Create data using numpy.Initialize the data using get_cmap, so that scatter knows.Using imshow() method with colormap, display the data as an image, i.e., on a 2D regular raster.Create the colorbar using the colorbar() method.To display the figure, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
600 Views
To enforce axis range in matplotlib, we can take the following steps −Set x and y limits using xlim and ylim methods, respectively.Create x and y points for the curve using numpy.Plot x and y using the plot() method.To show the figure, use the show() method.Exampleimport matplotlib.pyplot as plt import datetime import numpy as ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
3K+ Views
To plot a time series in Python using matplotlib, we can take the following steps −Create x and y points, using numpy.Plot the created x and y points using the plot() method.To display the figure, use the show() method.Exampleimport matplotlib.pyplot as plt import datetime import numpy as np plt.rcParams["figure.figsize"] = ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
515 Views
To plot multiple columns of a Pandas dataframe on the bar chart in matplotlib, we can take the following steps −Make a dictionary of different keys, between 1 to 10 range.Make a dataframe using Pandas dataframe.Create a bar plot, using the plot() method with kind=”bar”.To display the figure, use the show() method.Exampleimport ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
774 Views
To hide ticks label and keep the ticks in place, we can take the following steps −Initialize x1 and x10 variables to get the x and y points, using numpy.Plot points x and y using the plot() method.Using xticks method, get or set the current tick locations and labels of ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
985 Views
To get the list of figures in matplotlib, we can take the following steps −Using figure() method, create a new figure, or activate an existing figure. Creating x figures, i.e., x=3.To get the list of figures, use the plt.get_fignums() method.Examplefrom matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
3K+ Views
To get the color of the most recent plotted line, we can take the following steps −Create x and y points using numpy.Plot the line using x and y, with color red and linewidth 2.To get the color of the line, use the get_color() method, and print it.To display the ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
458 Views
To set the log scale tick label number on the axes, we can take the following steps −Set x and y axis limits (1 to 100), using ylim and xlim, on both the axes.Using loglog() method, make a plot with log scaling on both the x and y axis.To display the figure, use ... Read More