简体   繁体   中英

How to make interactive box plot Python?

I have Series names "rows" in DataFrame in Python like this:

在此处输入图像描述

The type of this column is "int64" my question is how can I build interacvite Box plot something like below, which will show me max, min and so on values, probably there have to be use:

import plotly.graph_objs as go
import plotly.offline as py

:

在此处输入图像描述

You can use the Box option from plotly graph objects to get the desired box plot

import plotly.graph_objects as go

fig = go.Figure()

fig.add_trace(go.Box(y=rows)) # if the series is independent of any dataframe

fig.show()

If your series is part of a dataframe, you can use the following

import plotly.graph_objects as go

fig = go.Figure()

fig.add_trace(go.Box(y=df['rows'])) # if the series is part of dataframe, df

fig.show()

Hope this helped

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM