Finding Mean and Standard Deviation

The mean and standard deviation of the data plotted by boxplot can be found using the boxmean parameter. It can take two values –

  • True for mean
  • sd for standard deviation.

Example:

Python3




import plotly.graph_objects as px
import numpy as np
 
 
# creating random data through randomint
# function of numpy.random
np.random.seed(42)
 
random_x1= np.random.randint(1,101,100)
random_x2= np.random.randint(1,101,100)
 
x = ['A', 'B', 'C', 'D']
 
plot = px.Figure()
 
plot.add_trace(px.Box(x=random_x1, marker_color = 'indianred', boxmean=True))
plot.add_trace(px.Box(x=random_x2, marker_color='royalblue', boxmean='sd'))
 
plot.show()


Output:

Box plot in Plotly using graph_objects class

Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.

Similar Reads

Box plot using graph objects class

If Plotly Express does not accommodate a good starting point, then it is also possible to use the more generic go.Box class from plotly.graph_objects. Box plot is a consistent way of distribution of data which are based on five main component shown below:...

Horizontal Box Plot

...

Finding Mean and Standard Deviation

The horizontal box plot is a box plot in which the x-variable and y-values are shown horizontally in the graph. It can be created by passing the x argument of the box plot....

Changing Algorithms for Quartiles

...

Showing The Underlying Data

The mean and standard deviation of the data plotted by boxplot can be found using the boxmean parameter. It can take two values –...

Contact Us