- 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 adjust the spacing between the edge of the plot and the X-axis, we can use tight_layout() method or set the bottom padding of the current figure.Set the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Plot x and y data ... Read More
Rishikesh Kumar Rishi
2K+ Views
To add footnote under the X-axis using matplotlib, we can use figtext() and text() method.StepsSet the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Plot x and y data points using numpy.To place the footnote, use figtext() method with x, y ... Read More
Rishikesh Kumar Rishi
434 Views
To plot yscale with class by name, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create y data points using numpy.Create x data points using numpy.Add a subplot to the current figure at index 1.Plot x and y data points using ... Read More
Rishikesh Kumar Rishi
1K+ Views
To locate the median in a seaborn KDE plot, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create random data using numpy.Find the median of data (Step 2).Use kdeplot() to plot the shaded region.Use axvline() method to plot the vertical line.To ... Read More
Rishikesh Kumar Rishi
5K+ Views
To set the margins of a matplotlib figure, we can use margins() method.StepsSet the figure size and adjust the padding between and around the subplots.Create t and y data points using numpy.Add a subplot to the current figure at index 1.Plot t and y data points using plot() method.Set the ... Read More
Rishikesh Kumar Rishi
8K+ Views
To set Y-axis limit, we can use ylim() method and put maximum and minimum limit values.StepsSet the figure size and adjust the padding between and around the subplots.Create two lists for data points.Make two variables for max and min values for Y-axis.Use ylim() method to limit the Y-axis range.Use bar() ... Read More
Rishikesh Kumar Rishi
6K+ Views
To improve matplotlib image quality we can use greater dot per inch i.e dpi value (greater than 600) and pdf or .eps format can be recommended.StepsSet the figure size and adjust the padding between and around the subplots.Make a 2D data raster using a np.array.Display data as an image, i.e., ... Read More
Rishikesh Kumar Rishi
1K+ Views
To annotate subplots in a figure with A, B and C using matplotlib, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create a figure and a set of subplots, with nrows=1 and ncols=3.Make a 1D iterator over an array.Iterate each axes ... Read More
Rishikesh Kumar Rishi
73 Views
To make matplotlib in OSX work in a virtual environment, we can first create a virtual environment and then activate that created environment. Thereafter, install all the dependencies in that virtual environment.StepsOpen ubuntu terminal.apt-get install python-venvpython -m venv source /bin/activate
Rishikesh Kumar Rishi
374 Views
To plot a stacked event duration using Python Pandas, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create a dataframe with lists of xmin and its corresponding xmax.Use hlines() method to plot a stacked event duration.To display the figure, use show() ... Read More