In [ ]:
from doepy import build
import plotly.express as px
import plotly
In [ ]:
df = build.full_fact(
{'Cooking time (mins)': [40,60],
'Oven temperature (C)': [150,200],
'Flour mass (g)': [300,400],}
) 
df
Out[ ]:
Cooking time (mins) Oven temperature (C) Flour mass (g)
0 40.0 150.0 300.0
1 60.0 150.0 300.0
2 40.0 200.0 300.0
3 60.0 200.0 300.0
4 40.0 150.0 400.0
5 60.0 150.0 400.0
6 40.0 200.0 400.0
7 60.0 200.0 400.0
In [ ]:
plotly.offline.init_notebook_mode(connected=True)
fig = px.scatter_3d(df,x='Cooking time (mins)', y='Oven temperature (C)', z='Flour mass (g)',
                    template="none",labels={
                     'Cooking time (mins)': 'Cooking time (mins)',
                     'Oven temperature (C)': 'Oven temperature (°C)',
                     'Flour mass (g)': 'Flour mass (g)'
                 })
fig.update_layout(font_family="Courier New",font_color="black",title_font_family="Courier New",title={
            'text' : "Full Factorial Design",
            'y':0.9,
            'x':0.5,
            'xanchor': 'center',
        })
fig.update_traces(marker=dict(size=8,color='mediumpurple',line=dict(width=2,
                                        color='DarkSlateGrey')), selector=dict(mode='markers'))
fig.update_layout(scene = dict(
                    xaxis = dict(
                         gridcolor="black",
                         showbackground=True,
                         zerolinecolor="black",
                         showgrid = True,
                         showline = True,
                         range = [35,65]),
                    yaxis = dict(
                        gridcolor="black",
                         showbackground=True,
                         zerolinecolor="black",
                         showgrid = True,
                         zeroline = True,
                         showline = True,
                         range = [145,205]),
                    zaxis = dict(
                       gridcolor="black",
                         showbackground=True,
                         zerolinecolor="black",
                         showgrid = True,
                         zeroline = True,
                         showline = True,
                        range = [295,405])),
                    width=700,
                    margin=dict(
                    r=20, l=10,
                    b=10, t=10)
                  )
fig.show()