Search code examples
pythonplotlyiplots

Outliers not showing up in plotly


Hi I am using this code to generate a boxplot: enter image description here

However, it is not showing all the data points also not showing up the outliers on the top. I am using this code:

import plotly.express as px

fig = px.box(dataset, y= 'Report_used',hover_name='entity_name')
fig.show()

It needs to be like this:

enter image description here

How can I do this? Thanks


Solution

  • import plotly.express as px
    
    fig = px.box(dataset,
        y= 'Report_used',
        hover_name='entity_name',
        points='all')
    fig.update_traces(pointpos=0)
    fig.show()
    

    If you wanted all the points to be on the whisker line:

    fig.update_traces(pointpos=0, jitter=0)