Rishikesh Kumar Rishi has Published 1162 Articles

Plotting a heatmap for 3 columns in Python with Seaborn

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 10-Aug-2021 06:49:00

1K+ Views

To plot a heatmap for 3 columns in Python with Seaborn, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a dataframe, df, with 3 columns.Plot the rectangular data as a color-encoded matrix.To display the figure, use show() method.Exampleimport seaborn ... Read More

How to plot two histograms side by side using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 10-Aug-2021 06:45:16

12K+ Views

To plot two histograms side by side using matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make two dataframes, df1 and df2, of two-dimensional, size-mutable, potentially heterogeneous tabular data.Create a figure and a set of subplots.Make a histogram of ... Read More

How to make a circular matplotlib.pyplot.contourf?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 10-Aug-2021 06:43:03

593 Views

To make a circular matplotlib.pyplot.contourf, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x, y, a, b and c data points using Numpy.Create a figure and a set of subplots.Make a Contour plot using contourf() method.Set the aspect ratios.To ... Read More

How to set the background color of a column in a matplotlib table?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 10-Aug-2021 06:40:23

1K+ Views

To set the background color of a column in a matplotlib table, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a tuple for columns attribute.Make a list of lists, i.e., list of records.Make a list of lists, i.e., color ... Read More

What are n, bins and patches in matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Aug-2021 07:32:56

1K+ Views

The hist() method returns n, bins and patches in matplotlib. Patches are the containers of individual artists used to create the histogram or list of such containers if there are multiple input datasets. Bins define the number of equal-width bins in the range.Let's take an example to understand how it ... Read More

How to get all the legends from a plot in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Aug-2021 06:59:56

1K+ Views

To get all the legends from a plot in matplotlib, we can use the get_children() method to get all the properties of an axis, then iterate all the properties. If an item is an instance of a Legend, then get the legend texts.stepsSet the figure size and adjust the padding ... Read More

Plot a multicolored line based on a condition in Python Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Aug-2021 06:55:26

3K+ Views

To plot a multicolored line based on a condition in Python Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create y data points using numpy.Make l and u data points to differentiate the colors.Plot the u and l data ... Read More

How to create a Boxplot with Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Aug-2021 06:52:19

154 Views

To create a Boxplot with Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a list of xticks.Plot a boxplot with xticks data.Set xticks and xtick labels with 45° rotation.To display the figure, use show() method.Exampleimport seaborn as sns ... Read More

How is the Pyplot histogram bins interpreted? (Matplotlib)

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Aug-2021 06:47:47

205 Views

To plot histogram bins interpreted with different bins, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a list of data to plot in histogram.Add a subplot to the current figure, nrows=1, ncols=3 and index=1.Plot a histogram with data; bins ... Read More

Annotating points from a Pandas Dataframe in Matplotlib plot

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Aug-2021 06:44:18

1K+ Views

To annotate points from a Pandas dataframe in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a two-dimensional, size-mutable, potentially heterogeneous tabular data, with x, y and textc columns.Plot the columns x and y data points, using plot() ... Read More

Advertisements