# SageMaker and Plotly Offline

**URL:** <https://community.plotly.com/t/sagemaker-and-plotly-offline/23837>\
**Category:** 📊 Plotly Python\
**Created:** [May 25, 2019, 2:23am UTC](https://community.plotly.com/t/sagemaker-and-plotly-offline/23837 "2019-05-25T02:23:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbrostrom](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@kbrostrom](https://community.plotly.com/u/kbrostrom)\
**Post date:** [May 25, 2019, 2:23am UTC](https://community.plotly.com/t/sagemaker-and-plotly-offline/23837/1 "2019-05-25T02:23:57Z")

</div>

I’m trying to use plotly offline iplot in JupyterLab on AWS SageMaker. When I use offline iplot, the graph adjusts to the default cell output heigh of 360px instead of adjust the cell output size to the default graph height of 450px. When I try to set the height to a fixed height of 600px, the cell doesn’t adjust and cuts off the bottom half of the graph.

I followed the instructions for installing all necessary widgets and extensions to work in JupyterLab. The following is my code.

`import plotly.offline as off  
import plotly.graph\_objs as go  
import numpy as np

off.init\_notebook\_mode(connected=True)

trace = go.Heatmap(z=[[1, 20, 30, 50, 1], [20, 1, 60, 80, 30], [30, 60, 1, -10, 20]],  
x=[‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’],  
y=[‘Morning’, ‘Afternoon’, ‘Evening’])  
data=[trace]  
layout = go.Layout(title=‘Activity Heatmap’)

f2 = go.Figure(data,layout)

# two different ways to view f2

off.iplot(f2)  
`  
Here is a picture of my output

[![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/1/1f9424945b94d16088f9485e791349dd47666344.png)](https://user-images.githubusercontent.com/47127806/58195579-23822a00-7c7d-11e9-836e-838042d401ed.png)

When I try to set the height manually to 600px in the layout, here is what I’m returned:

[![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/5/5a83c8744b3aa6f1695709e155d0ae9c38ea2930.png)](https://user-images.githubusercontent.com/47127806/58195634-48769d00-7c7d-11e9-8525-ea44c6e852a5.png)

I’ve tried with both go.Figure and go.FigureWidget

---

<div class="post-metadata">

**Author:** ![jmmease](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jmmease/32/3706_2.png) [@jmmease](https://community.plotly.com/u/jmmease)\
**Post date:** [May 27, 2019, 9:46am UTC](https://community.plotly.com/t/sagemaker-and-plotly-offline/23837/2 "2019-05-27T09:46:22Z")

</div>

Cross reference answer at [https://github.com/plotly/plotly.py/issues/1572#issuecomment-495159557](https://github.com/plotly/plotly.py/issues/1572#issuecomment-495159557)
