Rishikesh Kumar Rishi has Published 1162 Articles

How to modify the font size in Matplotlib-venn?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:57:34

1K+ Views

To modify the font size in Matplotlib-venn, we can use set_fontsize() method.StepsSet the figure size and adjust the padding between and around the subplots.Create three sets for Venn diagram.Plot a 3-set area-weighted Venn diagram.To set the set_labels and subset_labels fontsize, we can use set_fontsize() method.To display the figure, use show() ... Read More

How to plot a non-square Seaborn jointplot or JointGrid? (Matplotlib)

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:57:10

581 Views

To plot a non-square Seaborn jointplot or jointgrid, we can use set_figwidth() and set_figheight() methods.StepsSet the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Create a dataframe with two columns.Use jointplot() method to plot the jointplot.To make it non-square, we can ... Read More

How to add a legend on Seaborn facetgrid bar plot using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:56:43

4K+ Views

StepsSet the figure size and adjust the padding between and around the subplots.Create a dataframe with col1 columns.Multi-plot grid for plotting conditional relationships.Use map_dataframe(). This method is suitable for plotting with functions that accept a long-form DataFrame as a 'data' keyword argument and access the data in that DataFrame using ... Read More

How to retrieve the list of supported file formats for Matplotlib savefig()function?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:56:19

253 Views

To retrieve the list of supported file formats for matplotlib savefig() function, we can use get_supported_filetypes().StepsFirst get the current figure.Set the canvas that contains the figure.Use get_supported_filetypes() method.Iterate the file type items.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt fs = plt.gcf().canvas.get_supported_filetypes() for key, ... Read More

Animation using Matplotlib with subplots and ArtistAnimation

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:41:05

2K+ Views

To animate using Matplotlib with subplots and ArtistAnimation, 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.Create a user-defined function, Init, to draw a clear frame.Use FuncAnimation to make an animation by repeatedly ... Read More

How to decrease colorbar width in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:40:30

2K+ Views

To decrease colorbar width in Matplotlib, we can use shrink in colorbar() method.StepsSet the figure size and adjust the padding between and around the subplots.Create a random data using numpy.Display the data as an image, i.e., on a 2D regular raster, with data.Create a colorbar for a ScalarMappable instance, im.To ... Read More

How to make an arrow that loops in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:40:03

125 Views

To make an arrow that loops in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.To make an arrow loop in matplotlib, we can use make_loop() method.Make a wedge instance with center, radius, theta1, theta2 and width.To put the ... Read More

How to plot an angle spectrum using Matplotlib in Python?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:39:41

423 Views

To plot an angle spectrum, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Get random seed value.Initialize dt for sampling interval and find the sampling frequency.Create random data points for t.To generate noise, get nse, r, cnse and s, using ... Read More

How to change the datetime tick label frequency for Matplotlib plots?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:34:41

5K+ Views

To change the datetime tick label frequency for Matplotlib plots, we can create a dataframe and plot them in some date rangeStepsSet the figure size and adjust the padding between and around the subplots.To make potentially heterogeneous tabular data, use Pandas dataframe.Plot the dataframe using plot() method.Set X-axis major locator, ... Read More

Plot animated text on the plot in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 16-Jun-2021 14:59:27

2K+ Views

To animate text in a plot, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Set x and y axis limit.Initialize a variable, string.Use text() method to place text over the plot.Use FuncAnimation() to animate the text. Set text on the text ... Read More

Advertisements