Rishikesh Kumar Rishi has Published 1162 Articles

Golang Program to Find the Area of a Rectangle Using Classes

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 30-Jul-2021 15:17:39

399 Views

To find the area of a rectangle using classes, we can take following StepsDefine a struct with rectangle properties such as breadth and length.Define a method to calculate the area of the rectangle.In the main method, instantiate an object of rectangle.Call the struct method, i.e., Area, to calculate the area ... Read More

Golang Program to Read the Contents of a File

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 30-Jul-2021 09:44:00

742 Views

pre.prettyprint{width:99%!important;} a.demo{top:12px!important; float:right!important;}To read the contents of a file, we can take following steps −We can create a file called test.txt.Clean-up using defer statement.Write the contents of string.Call ReadFile() method to read the file.ReadFile reads the file named by filename and returns the contents.Print the content of the file.Example Live Demopackage ... Read More

How to automatically annotate the maximum value in a Pyplot?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jul-2021 07:34:46

7K+ Views

To annotate the maximum value in a Pyplot, 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.Make a list of x and y data points.Plot x and y data points using numpy.Find ... Read More

How to color a Seaborn boxplot based on DataFrame column name in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 08-Jul-2021 11:21:06

464 Views

To color a Seaborn boxplot based on dataframe column name, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a Pandas dataframe with two columns, col1 and col2.Make a boxplot with horizontal orientation.Get the boxes artists.Iterate the boxes and set ... Read More

How to draw rounded line ends using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 08-Jul-2021 11:18:41

1K+ Views

To draw rounded line ends using matplotlib, we can use solid_capstyle='round'.StepsSet the figure size and adjust the padding between and around the subplots.Create random x and y data points using numpy.Create a figure and a set of subplots.Plot x and y data points using plot() method, with solid_capstyle in the ... Read More

How to show date and time on the X-axis in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 08-Jul-2021 11:17:20

6K+ Views

To show date and time on the X-axis in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a list of dates and y values.Get the current axis.Set the major date formatter and locator.Plot x and y values using ... Read More

Plot 95% confidence interval errorbar Python Pandas dataframes in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 08-Jul-2021 11:15:57

1K+ Views

To plot 95% confidence interval errorbar Python Pandas dataframes, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Get a dataframe instance of two-dimensional, size-mutable, potentially heterogeneous tabular data.Make a dataframe with two columns, category and number.Find the mean and std ... Read More

How does parameters 'c' and 'cmap' behave in a Matplotlib scatter plot?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 08-Jul-2021 11:15:04

983 Views

To get a sense of how the parameters c and cmap behave in a Matplotlib scatterplot, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Initialize a variable N to store the number of sample data.Create x and y data points ... Read More

Creating multiple boxplots on the same graph from a dictionary, using Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 08-Jul-2021 11:12:31

2K+ Views

To create multiple boxplots on the same graph from a dictionary, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a dictionary, dict, with two columns.Create a figure and a set of subplots.Make a box and whisker plotSet the xtick ... Read More

How to edit the properties of whiskers, fliers, caps, etc. in a Seaborn boxplot in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 08-Jul-2021 11:11:38

439 Views

To edit the properties of whiskers, fliers, caps, etc. in a Seaborn boxplot, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a dataframe using Pandas.Make a boxplot from the DataFrame columns.Get the boxplot's outliers, boxes, medians, and whiskers data.Print ... Read More

Advertisements