python-plotly-boxplot Why not showing the max and minimum value on graph
Question: This is my data:[0, 45, 47, 46, 47,47,43,100]. And picture looks like this:
<https://plot.ly/~zfrancica/8/>

I want to have a picture like this: <https://plot.ly/~zfrancica/9/> (an out
come picture of [0, 45, 47, 46, 100] )

I want to have a fixed 0 minimum and 100 maximum.(May be this is not the
correct box plot but I want to fix the minimum and maximum.) How should I do
this?

(If ploty can't do this, a matplotlib plot code would also be fine.) My code:

    
    
    import plotly.plotly as py
    import plotly.graph_objs as go
    
    def box_plot(**kwargs):
        print kwargs
        num = len(kwargs['circum'])
        #WornPercentage = go.Box(x=kwargs['circum'])
        #data = [WornPercentage]
    
        #py.iplot(data)
    
        data = [
            go.Box(
                x=kwargs['circum'],
                boxpoints='all',
                jitter=0.3,
                pointpos=-1.8
            )
        ]
        py.iplot(data)
    
    
    
    process_dict={'circum':[0, 45, 47, 46, 47,47,43,100]}
    box_plot(**process_dict)
    


Answer: ### Credentials

For those who don't know how to save credentials permanently;

    
    
    import plotly.tools as tls
    tls.set_credentials_file(username='username', api_key='api-key')
    

Assuming you have already saved your credentials;

### A - Simple Solution

For a single one dimensional data;

    
    
    import plotly.plotly as py
    import plotly.graph_objs as go
    
    trace0 = go.Box(
        y=[0, 45, 47, 46, 47, 47, 43, 100], # Data provided
        name = 'Provided Data Chart',
        marker = dict(
            color = 'rgb(0, 0, 255)'        # Blue : #0000FF
        )
    )
    
    data = [trace0]
    py.plot(data)                           # Using plot instead of iplot
    

### A - Output

[![enter image description
here](http://i.stack.imgur.com/VaUWd.png)](http://i.stack.imgur.com/VaUWd.png)

### B - Using Layout

And you can also check this out for a nicer layout, there is a `range` option
you can use, for when `autorange` is set to `False`;

    
    
    import plotly.plotly as py
    import plotly.graph_objs as go
    from plotly.graph_objs import Layout
    from plotly.graph_objs import Font
    from plotly.graph_objs import YAxis
    from plotly.graph_objs import Figure
    
    trace0 = go.Box(
        y=[0, 45, 47, 46, 47, 47, 43, 100], # Data provided
        name = 'Provided Data Chart',
        marker = dict(
            color = 'rgb(0, 0, 255)'        # Blue : #00FF00
        )
    )
    
    data = [trace0]
    
    layout = Layout(
        autosize=True,
        font=Font(
            family='"Droid Sans", sans-serif'
        ),
        height=638,
        title='Plotly Box Demo',
        width=1002,
        yaxis=YAxis(
            autorange=False,                # Autorange set to False
            range=[0, 100],                 # Custom Range
            title='Y units',                # To be changed, units
            type='linear'                   # Use 'log' for appropriate data
        )
    )
    
    fig = Figure(data=data, layout=layout)
    
    plot_url = py.plot(fig)                 # Using plot instead of iplot
    

### B - Output

[![enter image description
here](http://i.stack.imgur.com/ioAWj.png)](http://i.stack.imgur.com/ioAWj.png)

Hope that it helps.

