Rishikesh Kumar Rishi has Published 1156 Articles

Box plot with min, max, average and standard deviation in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:34:20

5K+ Views

To make a box plot for min, max, average and standard deviation in matplotlib, StepsSet the figure size and adjust the padding between and around the subplots.Create a random dataset of 5☓5 dimension.Find min, max, average and standard deviation from the data.Make a Pandas dataframe with Step 3, min, max, ... Read More

Adding a scatter of points to a boxplot using Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:33:17

5K+ Views

To add a scatter of points to a boxplot using matplotlib, we can use boxplot() method and enumerate the Pandas dataframe to get the x and y data points to plot the scatter points.StepsSet the figure size and adjust the padding between and around the subplots.Make a dataframe using DataFrame ... Read More

How to center labels in a Matplotlib histogram plot?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:33:02

7K+ Views

To place the labels at the center in a histogram plot, we can calculate the mid-point of each patch and place the ticklabels accordinly using xticks() method.StepsSet the figure size and adjust the padding between and around the subplots.Create a random standard sample data, x.Initialize a variable for number of ... Read More

How to extract data from a Matplotlib plot?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:32:47

15K+ Views

To extract data from a plot in matplotlib, we can use get_xdata() and get_ydata() methods.StepsSet the figure size and adjust the padding between and around the subplots.Create y data points using numpy.Plot y data points with color=red and linewidth=5.Print a statment for data extraction.Use get_xdata() and get_ydata() methods to extract ... Read More

Show tick labels when sharing an axis in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:31:06

887 Views

To show the tick labels when sharing an axis, we can just use the subplot() method with sharey argument. By default, y ticklabels could be visible.StepsSet the figure size and adjust the padding between and around the subplots.Add a subplot to the current figure using subplot() method, where nrows=1, ncols=2 ... Read More

How to plot complex numbers (Argand Diagram) using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:22:41

644 Views

To plot complex numbers using matplotlib, we can make a dataset with complex numbers.StepsSet the figure size and adjust the padding between and around the subplots.Create random complex numbers.Create a figure and a set of subplots using subplots() method.Plot the scatter points using scatter() method.To display the figure, use show() ... Read More

Plotting multiple line graphs using Pandas and Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:22:03

4K+ Views

To plot multiple line graphs using Pandas and Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a 2D potentially heterogeneous tabular data using Pandas DataFrame class, where the column are x, y and equation.Get the reshaped dataframe organized ... Read More

How to animate a line plot in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 28-May-2021 15:16:11

3K+ Views

To animate the line plot in matplotlib, we can take the following steps −Create a figure and a set of subplots using subplots() method.Limit x and y axes scale.Create x and t data points using numpy.Return coordinate matrices from coordinate vectors, X2 and T2.Plot a line with x and F ... Read More

How to show multiple colorbars in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 15-May-2021 12:48:47

2K+ Views

To show multiple colorbars in matplotlib, we can take the following steps−Set the figure size and adjust the padding between and around the subplots.Create a figure and a set of subplots.Initialize a variable N for the number of sample data.Create random data1 using numpy.Display data as an image, i.e., on ... Read More

Plot a circle with an edgecolor in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 15-May-2021 12:46:06

2K+ Views

To plot a circle with an edgecolor 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 circle instance using Circle() class with an edgecolor and linewidth of the edge.Add a circle ... Read More

Advertisements