- 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
1K+ Views
To put edgecolor of a rectangle in matplotlib, we can take the following Steps −Create a new figure or activate an existing figure using figure() method.Add a subplot method to the current axis.Create a rectangle instance using Rectangle() class with an edgecolor and linewidth of the edge.Add a rectangle path ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
708 Views
To place labels between two ticks, we can take the following steps−Load some sample data, r.Create a copy of the array, cast to a specified type.Create a figure and a set of subplots using subplots() method.Plot date and r sample data.Set the locator of the major/minor ticker using set_major_locator() and ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
7K+ Views
To change a table's fontsize with matplotlib, we can use set_fontsize() method.StepsCreate a figure and a set of subplots, nrows=1 and ncols=1.Create random data using numpy.Create columns value.Make the axis tight and off.Initialize a variable fontsize to change the font size.Set the font size of the table using set_font_size() method.To ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
995 Views
To change subplot size or position after axes creation, we can take the following steps−Create a new figure or activate an existing figure using figure() method.Add an '~.axes.Axes' to the figure as part of a subplot arrangement using add_subplot() method.A grid layout to place subplots within a figure using GridSpec() ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
3K+ Views
To rotate matplotlib annotation to match a line, we can take the following steps−Create a new figure or activate an existing figure using figure() method.Add an '~.axes.Axes' to the figure as part of a subplot arrangement using add_subplot() method.Initialize the variables, m (slope) and c (intercept).Create x and y data ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
11K+ Views
plt.figure().close(): Close a figure window.close() by itself closes the current figureclose(h), where h is a Figure instance, closes that figureclose(num) closes the figure with number=numclose(name), where name is a string, closes the figure with that labelclose('all') closes all the figure windowsExamplefrom matplotlib import pyplot as plt fig = plt.figure() ax ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
7K+ Views
To plot a horizontal line on multiple subplots in Python, we can use subplots to get multiple axes and axhline() method to draw a horizontal line.StepsCreate a figure and a set of subplots. Here, we will create 3 subplots.Use axhline() method to draw horizontal lines on each axis.To display the ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
To overlay an image segmentation with numpy, we can take the following Steps −Make a masked array of 10×10 dimension.Update the masked array with 1 for some region.Make image data using numpy.Mask an array where a condition is met, to get the masked data.Create a new figure or activate an ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
1K+ Views
To limit the number of groups shown in a Seaborn countplot, we can use a variable group_count, used in countplot() method arguments.StepsCreate a figure and two sets of subplots.Create a data frame using Pandas, with two keys.Initalize a variable group_count to limit the group count in countplot() method.Use countplot() method ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
To plot a probability density function by sample, we can use numpy for x and y data points.StepsCreate x and p data points using numpy.Plot x and p data points using plot() method.Scale X-axis in a range.To display the figure, use show() method.Exampleimport numpy as np from matplotlib import pyplot ... Read More