Rishikesh Kumar Rishi has Published 1162 Articles

Plotting a cumulative graph of Python datetimes in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:32:12

520 Views

To plot a cumulative graph of python datetimes, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a Pandas dataframe with some college data, where one key for time difference and another key for number students have admissioned in the ... Read More

How can I programmatically select a specific subplot in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:30:41

524 Views

To select a specific subplot 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.Iterate in a range, i.e., number subplots to be placed.In the loop itself, add ... Read More

How to get smooth interpolation when using pcolormesh (Matplotlib)?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:29:34

2K+ Views

To get smooth interpolation when using pcolormesh, we can use shading="gouraud" class by name.StepsSet the figure size and adjust the padding between and around the subplots.Create data, x and y using numpy meshgrid.Create a pseudocolor plot with a non-regular rectangular grid using pcolormesh() method.To display the figure, use show() method.Exampleimport ... Read More

How to change axes background color in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Jun-2021 13:28:29

4K+ Views

To change the axes background color, we can use set_facecolor() method.StepsSet the figure size and adjust the padding between and around the subplots.Get the current axes using gca() method.Set the facecolor of the axes.Create x and y data points using numpy.Plot x and y data points using plot() method.To display ... Read More

Populating Matplotlib subplots through a loop and a function

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

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

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

741 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

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

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

Advertisements