# Export image has bars outside the axes

**URL:** <https://community.plotly.com/t/export-image-has-bars-outside-the-axes/2667>\
**Category:** plotly.js\
**Created:** [November 11, 2016, 10:56am UTC](https://community.plotly.com/t/export-image-has-bars-outside-the-axes/2667 "2016-11-11T10:56:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quath](https://avatars.discourse-cdn.com/v4/letter/q/a183cd/32.png) [@Quath](https://community.plotly.com/u/Quath)\
**Post date:** [November 11, 2016, 10:56am UTC](https://community.plotly.com/t/export-image-has-bars-outside-the-axes/2667/1 "2016-11-11T10:56:12Z")

</div>

Hi

I have 2 bar charts which are exported to png when clicking on a button. The export works fine (at least on Firefox and Chrome, haven’t tried on any other browser). However here is the catch:

- bar chart 1, has an yaxis property of ‘tozero’,
- bar chart 2, has an yaxis range not starting at zero

On the browser both are fine, however on the exported image … bar chart 2 has the bars outside the axes (see image)  
 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/1X/c2c83ed5cf6998fe5365f9d893092728d3446579.png)

both charts go through the same piece of code for the export Plotly.Snapshot.DownloadImage(… )

Did I miss a keyword or something or have I found a bug???

Cheers,

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [November 11, 2016, 3:20pm UTC](https://community.plotly.com/t/export-image-has-bars-outside-the-axes/2667/2 "2016-11-11T15:20:48Z")

</div>

Oh that’s bad.

Can you share a reproducible example of the graph you’re trying to export?

---

<div class="post-metadata">

**Author:** ![Quath](https://avatars.discourse-cdn.com/v4/letter/q/a183cd/32.png) [@Quath](https://community.plotly.com/u/Quath)\
**Post date:** [November 11, 2016, 4:45pm UTC](https://community.plotly.com/t/export-image-has-bars-outside-the-axes/2667/3 "2016-11-11T16:45:13Z")

</div>

Hi Etienne,

Apparently I have a gift for not being able to reproduce the issue again. … sic…  
I can show you a code which does reproduce nearly 90% of my code (and still not the bug) [here](https://fiddle.jshell.net/Quath/rymtp3L6/).

Were I to remove the range option on the yaxis, I would then no longer have that issue…  
I don’t know if that helps?

Keep you posted if I manage to make the bug in the fiddle, or get rid of it!

cheers,

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [November 11, 2016, 6:52pm UTC](https://community.plotly.com/t/export-image-has-bars-outside-the-axes/2667/4 "2016-11-11T18:52:51Z")

</div>

> [@Quath](#):
>
> Were I to remove the range option on the yaxis, I would then no longer have that issue…  
> I don’t know if that helps?

That shouldn’t matter, no.
