# Save plot on google cloud

**URL:** https://discuss.hail.is/t/save-plot-on-google-cloud/1086
**Category:** Hail Query & hailctl
**Created:** [September 20, 2019, 1:23pm UTC](https://discuss.hail.is/t/save-plot-on-google-cloud/1086 "2019-09-20T13:23:29Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pavlos](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/pavlos/32/303_2.png) [@pavlos](https://discuss.hail.is/u/pavlos)
#### Post date: [September 20, 2019, 1:23pm UTC](https://discuss.hail.is/t/save-plot-on-google-cloud/1086/1 "2019-09-20T13:23:29Z")

</div>

Hi,  
Do you have any examples - recommendations of a way to save a hail plot (manhattan plot) and write it to the google cloud bucket.  
I can’t save directly to the google bucket. I get file not found errors. All I managed to do successfully is to write on the hail cluster master node but it is not ideal. I have to at the moment ssh to the hail-master node and then I ‘gsutil cp’ my html images to my google bucket. I am sure there is a much better way of doing this…

My code below for saving the plots for 35 covariates:

```
for i in range (0,36):
        print(f"Plotting {i}:{covariates[i]}")
        p = hl.plot.manhattan(gwas.p_value[i], title=f"Interval WGS GWAS Manhattan Plot: {covariates[i]}")
        output_file(f"wgs-manhattan-{covariates[i]}.html")
        save (p )

        p = hl.plot.qq(gwas.p_value[i], title=f"Interval WGS GWAS QQ Plot: {covariates[i]}" )
        #output_file(f"{BUCKET}/output-tables/wgs-qq-{covariates[i]}.html")
        output_file(f"wgs-qq-{covariates[i]}.html")
        save(p)

```

Thank you again,  
Pavlos

---

<div class="post-metadata">

### Author: ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)
#### Post date: [September 20, 2019, 4:00pm UTC](https://discuss.hail.is/t/save-plot-on-google-cloud/1086/2 "2019-09-20T16:00:54Z")

</div>

It’s possible to do this programmatically with hail:

```python
hl.hadoop_copy(local_file_html, 'gs://bucket/...')

```

[https://hail.is/docs/0.2/utils/index.html#hail.utils.hadoop\_copy](https://hail.is/docs/0.2/utils/index.html#hail.utils.hadoop_copy)

---

<div class="post-metadata">

### Author: ![pavlos](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/pavlos/32/303_2.png) [@pavlos](https://discuss.hail.is/u/pavlos)
#### Post date: [September 20, 2019, 4:07pm UTC](https://discuss.hail.is/t/save-plot-on-google-cloud/1086/3 "2019-09-20T16:07:53Z")

</div>

That’s perfect, thank you @tpoterba! 🙂

---

<div class="post-metadata">

### Author: ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)
#### Post date: [September 20, 2019, 4:09pm UTC](https://discuss.hail.is/t/save-plot-on-google-cloud/1086/4 "2019-09-20T16:09:06Z")

</div>

If running from a jupyter notebook, you can also run shell commands inline using the `!` magic:

```auto
! gsutil cp local_file_html gs:/...

```

---

<div class="post-metadata">

### Author: ![jotes](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jotes](https://discuss.hail.is/u/jotes)
#### Post date: [June 4, 2020, 9:01pm UTC](https://discuss.hail.is/t/save-plot-on-google-cloud/1086/5 "2020-06-04T21:01:09Z")

</div>

Hi @tpoterba. I am running hail on an hpc system. I would like to save hail plot in my directory locally. I tried looking for a save function in hail.plot but I can’t find it.  
I am not running from jupyternotebook. I have an already prepared .py script which I run .

---

<div class="post-metadata">

### Author: ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)
#### Post date: [June 4, 2020, 9:03pm UTC](https://discuss.hail.is/t/save-plot-on-google-cloud/1086/6 "2020-06-04T21:03:07Z")

</div>

Hail plots use bokeh. Pavlos above is using the output\_file and save functions imported from bokeh as in this post: [https://stackoverflow.com/questions/31562898/bokeh-save-plot-as-html-but-dont-show-it](https://stackoverflow.com/questions/31562898/bokeh-save-plot-as-html-but-dont-show-it)
