Rishikesh Kumar Rishi has Published 1156 Articles

How to make axes transparent in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:26:21

3K+ Views

To make axes transparent in matplotlib, 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.Axes' to the figure as part of a subplot arrangement.Set face color of ... Read More

How to name different lines in the same plot of Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:25:14

1K+ Views

To name different lines in the same plot of matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make two lists of data points.Plot point1 and point2 using plot() method.Place a legend on the figure.To display the figure, use show() ... Read More

Drawing circles on an image with Matplotlib and NumPy

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:24:09

2K+ Views

To draw a circle on an image with matplotlib and numpy, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Read an image from a file into an array.Create x and y data points using numpy.Create a figure and a set ... Read More

How to change the legend fontname in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:22:28

737 Views

To change the legend fontname in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x data points using numpy.Plot x, sin(x) and cos(x) using plot() method.Use legend() method to place the legend.Iterate legend.get_texts() and update the legend fontname.To ... Read More

Adding units to heatmap annotation in Seaborn

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:21:11

652 Views

To add units to a heatmap annotation in Seaborn, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a 5×5 dimension matrix using numpy.Plot rectangular data as a color-encoded matrix.Annotate heatmap value with %age unit.To display the figure, use show() ... Read More

How to color a Matplotlib scatterplot using a continuous value?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:19:56

7K+ Views

To color a matplotlib scatterplot using continuous value, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x, y and z random data points using numpy.Create a figure and a set of subplots.Create a scatter plot.Draw a colorbar in an ... Read More

Text alignment in a Matplotlib legend

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:18:42

5K+ Views

To make text alignment in a matplotlib legend, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x data points using numpy.Plot x, sin(x) and cos(x) using plot() method.Place legend using legend() method and initialize a method.Iterate the legend.get_texts() method ... Read More

Plot Matplotlib 3D plot_surface with contour plot projection

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:16:49

745 Views

To plot 3d plot_surface with contour plot projection, we can use plot_surface() and contourf() methods.StepsSet the figure size and adjust the padding between and around the subplots.Create x, y, X, Y and Z data points using numpy.Create a new figure or activate an existing figure using figure() method.Add an '~.axes.Axes' ... Read More

How to add Matplotlib Colorbar Ticks?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:15:23

5K+ Views

To add ticks to the colorbar, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x, y and z data points using numpy.Use imshow() method to display the data as an image, i.e., on a 2D regular raster.Create ticks using ... Read More

How to change the font properties of a Matplotlib colorbar label?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:14:11

3K+ Views

To change the font properties of a matplotlib colorbar label, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x, y and z data points using numpy.Use imshow() method to display the data as an image, i.e., on a 2D ... Read More

Advertisements