Rishikesh Kumar Rishi has Published 1156 Articles

How to show a figure that has been closed in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 12:31:25

958 Views

To show a figure that has been closed in Matplotlib, we can create a new Canvas Manager and store the previous figure into a new Canvas figure.StepsSet the figure size and adjust the padding between and around the subplots.Create a new figure or activate an existing figure.Create x and y ... Read More

How to set the Y-axis in radians in a Python plot?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 12:29:24

933 Views

To set the Y-axis in radians in a Python plot, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x and y data point using numpy.Create a new figure or activate an existing figure using figure() method.Add an axes, ax, ... Read More

How to plot histograms from dataframes in Pandas using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 12:24:36

584 Views

To plot histograms against Pandas/Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a potentially hetrogeneous tabular data using Pandas dataframe.Use the dataframe to make a histogram.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt import ... Read More

How can box plot be overlaid on top of swarm plot in Seaborn?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 12:22:32

517 Views

To plot a Box plot overlaid on top of a Swarm plot in Seaborn, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a Pandas dataframe, i.e., two-dimensional, size-mutable, potentially heterogeneous tabular data.Initialize the plotter, swarmplot.To plot the box plot, ... Read More

Setting the display range suplot of errorbars in matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 12:17:31

124 Views

To set the display range subplot or errorbars in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Create a figure and a set of subplots.Plot y versus x as lines and/or markers ... Read More

Adjust the width of box in boxplot in Python Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 12:14:33

7K+ Views

To adjust the width of box in boxplot in Python matplotlib, we can use width in the boxplot() method.StepsSet the figure size and adjust the padding between and around the subplots.Make a Pandas dataframe, i.e., two-dimensional, size-mutable, potentially heterogeneous tabular data.Make a box and whisker plot, using boxplot() method with ... Read More

How to draw a heart with pylab?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 12:12:27

1K+ Views

To draw a heart with pylab/pyplot, we can follow the steps given below −StepsSet the figure size and adjust the padding between and around the subplots.Create x, y1 and y2 data points using numpy.Fill the area between (x, y1) and (x, y2) using fill_between() method.Place text on the plot using ... Read More

How to save an image with matplotlib.pyplot?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 12:10:48

5K+ Views

To save an image with matplotlib.pyplot.savefig(), we can take the following steps −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 points using plot() method.To save the figure, use savefig() method.Exampleimport numpy as np import ... Read More

Golang Program to Determine Recursively Whether a Given Number is Even or Odd

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Aug-2021 07:09:21

345 Views

StepsTake a number from the user and store it in a variable.Pass the number as an argument to a recursive function.Define the base condition as the number to be lesser than 2.Otherwise, call the function recursively with the number minus 2.Then, return the result and check if the number is ... Read More

Golang Program to Read Two Numbers and Print their Quotient and Remainder

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 02-Aug-2021 06:06:15

337 Views

To print the Quotient and Remainder of two numbers, we can use the division operator and the modulo operator.Let's take an Example:a = 15 and b = 2Quotient is 15/2 = 7Remainder is 15 % 2 = 1StepsDefine the variables, a and b.Use print statement for the first number.Use print ... Read More

Advertisements