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]
sghuisman
(Sander Huisman)
June 10, 2015, 9:04am
2
Provide a number for the ImageSize in pl. Then use Rasterize using the “Image” second argument
Rasterize[pl,"Image",Rastersize-> ....]
kayh
(Kay Herbert)
June 10, 2015, 1:24pm
3
“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
sghuisman
(Sander Huisman)
June 10, 2015, 1:27pm
4
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…
sghuisman
(Sander Huisman)
June 10, 2015, 1:36pm
6
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 400x and 1000 x, but are visually similar, no change in relative tick size.
The ImageSize -> Scaled[0.7] seem to be causing the problem.
sghuisman
(Sander Huisman)
June 10, 2015, 8:37pm
8
You are correct, that is what I said: “Provide a number for the ImageSize in pl.”