# How can we export a graphic without the border?

**URL:** <https://community.wolfram.com/t/how-can-we-export-a-graphic-without-the-border/1362>\
**Category:** Questions\
**Tags:** mathematica, graphics-and-visualization\
**Created:** [January 25, 2014, 9:45pm UTC](https://community.wolfram.com/t/how-can-we-export-a-graphic-without-the-border/1362 "2014-01-25T21:45:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [January 25, 2014, 9:45pm UTC](https://community.wolfram.com/t/how-can-we-export-a-graphic-without-the-border/1362/1 "2014-01-25T21:45:02Z")

</div>

I have been using Mathematica to generate test images. The images are designed to have a specific dimension and resolution. What I want is for the graphic as designed to be exactly exported as a tiff or jpeg conmpletely filling the designed-for size. Unfortunately, Mathematica wants to add a border to everything, so when the image is exported at the intended size, it includes this unwanted border, and the dimensions in pixels of the internal components have been altered.

Does anyone know how to eliminate this border? Note that just chopping it off does not work because including it in the export already re-rasterized the image, so the internal components have changed in unspecified ways.

Regards,  
David

---

<div class="post-metadata">

**Author:** ![dzviovich](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dzviovich/32/27395_2.png) [@dzviovich](https://community.wolfram.com/u/dzviovich)\
**Post date:** [January 25, 2014, 10:09pm UTC](https://community.wolfram.com/t/how-can-we-export-a-graphic-without-the-border/1362/2 "2014-01-25T22:09:47Z")

</div>

David, what format are you trying to export?

```auto
data = RandomVariate[NormalDistribution[4, 0.5], 1000];
Histogram[data, Automatic, "Probability", 

 PlotLabel -> "Just an Example"]
Export["example.png", %]

```

 ![example.png](https://global.discourse-cdn.com/wolfram/original/3X/9/0/90a5a317723f0bdfd1142211d6c739e6e752a654.png)

has no border on my machine running MMA 9

---

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [January 26, 2014, 12:44am UTC](https://community.wolfram.com/t/how-can-we-export-a-graphic-without-the-border/1362/3 "2014-01-26T00:44:58Z")

</div>

Hi Diego,  
My graphic is built explicitly of primities. It might be for example a filled rectange of a certan size. Here is a screen clip from it’s appearance in the notebook when the graphic is selected. The largest extent of the defined graphic is the dark background, but it’s grown a border.

 ![MMA_Border.png](https://global.discourse-cdn.com/wolfram/original/3X/c/3/c3a305932fa241764e24a3c732962e31a01eef94.png)

When this is exported as a TIFF and then imported into Photoshop we get this. The gray is the Photoshop window background. The white border was exported by Mathematica as part of the image. It was added gratuitously and is unwanted.

 ![MMA_Border_PS.png](https://global.discourse-cdn.com/wolfram/original/3X/5/4/54e6e5e0ef446e867de8530af734db9d130bef81.png)

---

<div class="post-metadata">

**Author:** ![cormullion](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@cormullion](https://community.wolfram.com/u/cormullion)\
**Post date:** [January 26, 2014, 9:25am UTC](https://community.wolfram.com/t/how-can-we-export-a-graphic-without-the-border/1362/4 "2014-01-26T09:25:03Z")

</div>

Try adding **PlotRangePAdding → 0** to your code.

---

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [January 26, 2014, 5:09pm UTC](https://community.wolfram.com/t/how-can-we-export-a-graphic-without-the-border/1362/5 "2014-01-26T17:09:17Z")

</div>

Yes -- That worked. Thanks very much!
