# PlotLegends and Graph blow out of proportions when rasterized

**URL:** <https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915>\
**Category:** Questions\
**Tags:** mathematica\
**Created:** [June 10, 2015, 4:46am UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915 "2015-06-10T04:46:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![boristhphys](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/boristhphys/32/3064_2.png) [@boristhphys](https://community.wolfram.com/u/boristhphys)\
**Post date:** [June 10, 2015, 4:46am UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915/1 "2015-06-10T04:46:24Z")

</div>

How can I make `Rasterize` to reproduce the graph and the legends in correct proportions? Thanks.

```
pl = Plot[Sin[x], {x, 0, 2 \[Pi]}, PlotRange -> Full, 
  AxesOrigin -> {0, 0}, PlotLegends -> names, PlotStyle -> Thick, 
  AxesStyle -> Directive[Black, 21], ImageSize -> Scaled[0.7] ]

Rasterize[pl, RasterSize -> 3000, ImageSize -> 1000]

```

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [June 10, 2015, 9:04am UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915/2 "2015-06-10T09:04:54Z")

</div>

Provide a number for the ImageSize in pl. Then use Rasterize using the “Image” second argument

```
Rasterize[pl,"Image",Rastersize-> ....]

```

---

<div class="post-metadata">

**Author:** ![kayh](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/kayh/32/31501_2.png) [@kayh](https://community.wolfram.com/u/kayh)\
**Post date:** [June 10, 2015, 1:24pm UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915/3 "2015-06-10T13:24:45Z")

</div>

“Image” doesn’t do anything for me (except turn graphics into an image) but reducing the rastersize works:

```
Rasterize[pl, RasterSize -> 1024, ImageSize -> 640]

```

Running 10.1 on windows 8.1

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [June 10, 2015, 1:27pm UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915/4 "2015-06-10T13:27:25Z")

</div>

It looks the same with or without the “Image” argument, but the result is different; an Image or a Graphics object…  
ImageSize in Rasterize is only the "print"size of the output, not the size of the original image before rasterizing. That i why you have to set the imagesize explicitly in the plot to be sure…

---

<div class="post-metadata">

**Author:** ![kayh](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/kayh/32/31501_2.png) [@kayh](https://community.wolfram.com/u/kayh)\
**Post date:** [June 10, 2015, 1:33pm UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915/5 "2015-06-10T13:33:45Z")

</div>

outputs with image:

1. 3000x1000

 ![10535Untitled-1.png](https://global.discourse-cdn.com/wolfram/original/2X/b/bd0c6079422b4d02ceda408925b7581bde8e5d2c.png)

1. 1000x600:

 ![Untitled-2.png](https://global.discourse-cdn.com/wolfram/original/3X/1/a/1ab90d99ddb74c7a4f944a9c0e40feb30dc9316f.png)

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [June 10, 2015, 1:36pm UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915/6 "2015-06-10T13:36:33Z")

</div>

It’s very easy, try this…

```
Plot[Sin[x], {x, 0, 2 \[Pi]}, ImageSize -> 300]
Rasterize[%, "Image", RasterSize -> 400]
Rasterize[%%, "Image", RasterSize -> 1000]

```

The ImageDimensions of the the Plots should be 400_x and 1000_x, but are visually similar, no change in relative tick size.

---

<div class="post-metadata">

**Author:** ![boristhphys](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/boristhphys/32/3064_2.png) [@boristhphys](https://community.wolfram.com/u/boristhphys)\
**Post date:** [June 10, 2015, 7:19pm UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915/7 "2015-06-10T19:19:21Z")

</div>

The `ImageSize -> Scaled[0.7]` seem to be causing the problem.

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [June 10, 2015, 8:37pm UTC](https://community.wolfram.com/t/plotlegends-and-graph-blow-out-of-proportions-when-rasterized/5915/8 "2015-06-10T20:37:08Z")

</div>

You are correct, that is what I said: “Provide a number for the ImageSize in pl.”
