Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to save the following plot as a pdf, so that I can import it into LaTeX:

Grid[{{RegionPlot[{x<y,x>y},{x,-2-1/10,2+1/10},{y,-1/10,3+1/10},PlotPoints->20,PlotStyle->{Texture[Graphics[Table[Circle[{i,j},1/4],{i,20},{j,20}]]],Texture[Graphics[Table[Polygon[{{1+i,0+j},{0+i,Sqrt[3]+j},{-1+i,0+j}}],{i,2,80,4},{j,2,80,4}]]]},BoundaryStyle->Black,PlotRange->{{-2,2},{0,3}},ImageSize->350],Grid[{{Graphics[Table[Circle[{i,j},1/4],{i,3},{j,3}],ImageSize->30,Frame->True,FrameTicks->None],"(Min, Min) & (Mix, Max)"},{Graphics[Table[Polygon[{{1+i,0+j},{0+i,Sqrt[3]+j},{-1+i,0+j}}],{i,2,10,4},{j,2,10,4}],ImageSize->30,Frame->True,FrameTicks->None],"(Mix, Max)"}},Spacings->{1,1/2}]}},Spacings->{2,1}]

However, if I right-click on the output and click 'save selection as', the pdf I get changes the RegionPlot into a image (probably jpeg). However, it does manage to keep the Graphics, to the right of the RegionPlot, as a non-image pdf code.

I believe this is due to the function Texture, which turns the Graphics inside Texture into an image.

How can I get the full output into non-image pdf code?

share|improve this question
2  
As you say, it's because of Texture. The reason is that Texture always rasterizes its input. So this is not a problem with Save Selection but with the way the original RegionPlot is created. You have to choose a different approach to create the main plot. This would probably involve the answers here: Filling a polygon with a pattern of insets. –  Jens May 26 at 19:49
    
Thanks! I managed by making clever use of polygons. –  LBogaardt May 27 at 16:43

1 Answer 1

plt1 = Grid[{{RegionPlot[{x < y, x > y}, {x, -2 - 1/10, 2 + 1/10}, {y, -1/10, 3 + 1/10}, PlotPoints -> 20, PlotStyle -> {Texture[ Graphics[Table[Circle[{i, j}, 1/4], {i, 20}, {j, 20}]]], Texture[Graphics[ Table[Polygon[{{1 + i, 0 + j}, {0 + i, Sqrt[3] + j}, {-1 + i, 0 + j}}], {i, 2, 80, 4}, {j, 2, 80, 4}]]]}, BoundaryStyle -> Black, PlotRange -> {{-2, 2}, {0, 3}}, ImageSize -> 350], Grid[{{Graphics[Table[Circle[{i, j}, 1/4], {i, 3}, {j, 3}], ImageSize -> 30, Frame -> True, FrameTicks -> None], "(Min, Min) & (Mix, Max)"}, {Graphics[ Table[Polygon[{{1 + i, 0 + j}, {0 + i, Sqrt[3] + j}, {-1 + i, 0 + j}}], {i, 2, 10, 4}, {j, 2, 10, 4}], ImageSize -> 30, Frame -> True, FrameTicks -> None], "(Mix, Max)"}}, Spacings -> {1, 1/2}]}}, Spacings -> {2, 1}];

Export["Desktop/example.pdf", plt1]

share|improve this answer
1  
Nope, doesn't work. –  LBogaardt May 26 at 18:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.