Rishikesh Kumar Rishi has Published 1156 Articles

Find the area between two curves plotted in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:35:20

1K+ Views

To find the area between two curves plot in matplotlib, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create x, c1 and c2 data points using numpy.Plot (x, c1) and (x, c2) using plot() methods.Fill the area between the two curves, ... Read More

How to make the Parula colormap in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:34:01

1K+ Views

To make the Parula colormap in matplotlib, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create colormap data using numpy.Create a 'LinearSegmentedColormap' from a list of colors.Viscum is a little tool for analyzing colormaps and creating new colormaps.Use imshow() method to ... Read More

Setting the size of the plotting canvas in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:32:11

3K+ Views

To set the size of the plotting canvas in matplotlib, we can take the following steps:Set the figure size and adjust the padding between and around the subplots. Use figsize 7.50 and 3.50 to set the figure size.Create x and y data points using numpy.Plot x and y data points ... Read More

What is the name of the default Seaborn color palette?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:29:38

325 Views

To get the default Seaborn color palette, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Return a list of colors or continuous colormap defining a palette.Plot the values in a color palette as a horizontal array.To display the figure, use show() ... Read More

How to get different font sizes in the same annotation of Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:28:26

3K+ Views

To add different font sizes in the same annotation method, we can take the following stepsMake lists of x and y data points where text could be placed.Initialize a variable 'labels', i.e., a string.Make a list of sizes of the fonts.Use subplots() method to create a figure and a set ... Read More

How to load an image and show the image using Keras?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:26:28

2K+ Views

To load an image and show the image using Keras, we will use load_image() method to load an image and set the target size of the image to be shown.StepsUse load_img() method to load the figure.Set the target size of the image.To display the figure, use show() method.Examplefrom keras.preprocessing import ... Read More

Adjusting the spacing between the edge of the plot and the X-axis in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:24:21

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

How to add footnote under the X-axis using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:21:06

3K+ 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

Plot yscale class linear, log, logit and symlog by name in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:17:35

518 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

How to locate the median in a (Seaborn) KDE plot?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Jun-2021 08:14:40

2K+ 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

Advertisements