- 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
10K+ Views
To add a varaible to Python plt.title(), we can take the following steps −Create data points for x and y using numpy and num (is a variable) to calculate y and set this in title.Plot x and y data points using plot() method with red color.Set the title of the curve with variable ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
To plot data from multiple two-column text files with legends in matplotlib, we can take the following steps −Import genfromtxt from pylab. It has several options to read data from a text file and plot the data.Read two text files, test.txt and test1.txt (having two columns of data), using genfromtxt and store the data ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
1K+ Views
To hide matplotlib descriptions of an instance while calling plot() method, we can take the following steps −Open Ipython instance.import numpy as npfrom matplotlib, import pyplot as pltCreate points for x, i.e., np.linspace(1, 10, 1000)Now, plot the line using plot() method.To hide the instance, use plt.plot(x); i.e., (with semi-colon)Or, use _ ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
1K+ Views
To plot multiple columns of Pandas DataFrame using Seaborn, we can take the following steps −Make a dataframe using Pandas.Plot a bar using Seaborn's barplot() method.Rotate the xticks label by 45 angle.To display the figure, use show() method.Exampleimport pandas import matplotlib.pylab as plt import seaborn as sns import numpy as np ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
772 Views
To set different error bar colors in barplot in matplotlib, we can take the following steps −Create a figure and add a set of subplots using subplots() method.Make a barplot with data range 4, heights 2. yerr means vertical errorbars to the bar tips. The values are sizes relative to the ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
711 Views
To display Y-axis range using absolute values rather than offset values, we can take the following steps −Create x_data and y_data data points in the range of 100 to 1000.Create a figure and a set of subplots using subplots() method.Plot x_data and y_data using plot() method.If a parameter is not set, the corresponding property ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
To draw lines between two plots in matplotlib, we can take the following steps −Create a new figure or activate an existing figure.Add two axes (ax1 and ax2) to the figure as part of a subplot arrangement.Create random data x and y using numpy.Plot x and y data points on ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
3K+ Views
To display or hide box border in matplotlib, we can use spines (value could be right, left, top or bottom) and set_visible() method to set the visibility to True or False.StepsCreate x and y data points using numpy.Create a figure and add a set of subplots using subplots() method.Plot x ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
2K+ Views
To adjust (offset) the colorbar title in matplotlib, we can take the following steps −Create a random data of 4×4 dimension.Use imshow() method to display the data as an imgage.Create a colorbar for a scalar mappable instance using colorbar() method, with im mappable instance.Now, adjust (offset) the colorbar title in matplotlib, with labelpad=-1. ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
7K+ Views
To increase plt.title font size, we can initialize a variable fontsize and can use it in the title() method's argument.StepsCreate x and y data points using numpy.Use subtitle() method to place the title at the center.Plot the data points, x and y.Set the title with a specified fontsize.To display the figure, use ... Read More