Rishikesh Kumar Rishi has Published 1156 Articles

Populating Matplotlib subplots through a loop and a function

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:27:19

6K+ Views

To populate matplotlib subplots through a loop and a function, 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 with number of rows = 3 and number of columns = 2.Make a function ... Read More

How to hide the colorbar of a Seaborn heatmap?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:25:23

9K+ Views

To hide the colorbar of a Seaborn heatmap, we can use cbar=False in heatmap() method.StepsSet the figure size and adjust the padding between and around the subplots.Make a dataframe using 4 columns.Use heatmap() method to plot rectangular data as a color-encoded matrix.To display the figure, use show() method.Exampleimport seaborn as ... Read More

Setting active subplot using axes object in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:23:53

1K+ Views

To set active subplot axes object in matplotlib, we can use subplots() method to add the axes as a subplot arrangement.StepsSet the figure size and adjust the padding between and around the subplots.Create x and y lists for data points.Create a figure and a set of subplots using subplots() method ... Read More

How to insert a scale bar in a map in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:22:22

2K+ Views

To insert a scale bar in a map in matplotlib, we can use AnchoredBar() class to instantiate the scalebar object.StepsSet the figure size and adjust the padding between and around the subplots.Create random data using numpy.Use imshow() method to display data as an image, i.e., on a 2D regular raster.Get ... Read More

How to plot gamma distribution with alpha and beta parameters in Python using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:21:09

2K+ Views

To plot gamma distribution with alpha and beta parameters in Python, we can use gamma.pdf() function.StepsSet the figure size and adjust the padding between and around the subplots.Create x using numpy and y using gamma.pdf() function at x of the given RV.Plot x and y data points using plot() method.Use ... Read More

How to change the font size of scientific notation in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:19:55

2K+ Views

To change the fontsize of scientific notation in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a list of x and y values.Plot x and y data points using plot() method.To change the font size of scientific notation, ... Read More

How do I plot hatched bars using Pandas and Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:18:35

2K+ Views

To plot hatches bars using Pandas, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a dataframe using Pandas with two columns.Add an axes to the current figure as a subplot arrangement.Make a plot with kind="bars" class by name.Make a ... Read More

How to surface plot/3D plot from a dataframe (Matplotlib)?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:17:16

3K+ Views

To surface plot/3d, we would require 2D data points, not 1D dataframe.StepsSet the figure size and adjust the padding between and around the subplots.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 a ... Read More

How to show different colors for points and line in a Seaborn regplot?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:16:04

3K+ Views

To show different colors for points and line in a Seaborn regplot, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a Pandas dataframe with key X-axis and Y-axis.Plot numeric independent variables with regression model.To display the figure, use show() ... Read More

How can I render 3D histograms in Python using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:14:55

4K+ Views

To render 3D histograms in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a new figure or activate an existing figure using figure() method.Add an axes to the cureent figure as a subplot arrangement.Create x3, y3 and z3 ... Read More

Advertisements