Skip to main content
deleted 6 characters in body
Source Link
preeti
  • 833
  • 1
  • 7
  • 17

I have a figure (which is by combining different plots) that I generated using Grid[]. The problem is, I want to specify the ImageSize of this final figure. I am unable to do it in Grid[]. Therefore, I wanted to convert this Grid[] object to Graphics[] object so that I can save it as a PDF of desired ImageSize.

Note: I tried to save the output of Grid[] as PDF using Export[]. It works fine. However, when I set ImageSize in Export[], it seems to be ignored.

I tried

i=First@ImportString[ExportString[figure, "PDF"]];

But even this seems to lose clarity but this gives crispier image than Rasterize

Magnify[] 

Magnify[] seems to do what I want even if It doesn't convert the figure to graphics, I can change the resolution by trial and error. Not the best way to do it but gets the job done.

I have a figure (which is by combining different plots) that I generated using Grid[]. The problem is, I want to specify the ImageSize of this final figure. I am unable to do it in Grid[]. Therefore, I wanted to convert this Grid[] object to Graphics[] object so that I can save it as a PDF of desired ImageSize.

Note: I tried to save the output of Grid[] as PDF using Export[]. It works fine. However, when I set ImageSize in Export[], it seems to be ignored.

I tried

i=First@ImportString[ExportString[figure, "PDF"]];

But even this seems to lose clarity but this gives crispier image than Rasterize

Magnify[] 

seems to do what I want even if It doesn't convert the figure to graphics, I can change the resolution by trial and error. Not the best way to do it but gets the job done.

I have a figure (which is by combining different plots) that I generated using Grid[]. The problem is, I want to specify the ImageSize of this final figure. I am unable to do it in Grid[]. Therefore, I wanted to convert this Grid[] object to Graphics[] object so that I can save it as a PDF of desired ImageSize.

Note: I tried to save the output of Grid[] as PDF using Export[]. It works fine. However, when I set ImageSize in Export[], it seems to be ignored.

I tried

i=First@ImportString[ExportString[figure, "PDF"]];

But even this seems to lose clarity but this gives crispier image than Rasterize

Magnify[] seems to do what I want even if It doesn't convert the figure to graphics, I can change the resolution by trial and error. Not the best way to do it but gets the job done.

changed to include one of the suggestions
Source Link
preeti
  • 833
  • 1
  • 7
  • 17

I have a figure (which is by combining different plots) that I generated using Grid[]. The problem is, I want to specify the ImageSize of this final figure. I am unable to do it in Grid[]. Therefore, I wanted to convert this Grid[] object to Graphics[] object so that I can save it as a PDF of desired ImageSize.

Note: I tried to save the output of Grid[] as PDF using Export[]. It works fine. However, when I set ImageSize in Export[], it seems to be ignored.

I tried

i=First@ImportString[ExportString[figure, "PDF"]];

But even this seems to lose clarity but this gives crispier image than Rasterize

Magnify[] 

seems to do what I want even if It doesn't convert the figure to graphics, I can change the resolution by trial and error. Not the best way to do it but gets the job done.

I have a figure (which is by combining different plots) that I generated using Grid[]. The problem is, I want to specify the ImageSize of this final figure. I am unable to do it in Grid[]. Therefore, I wanted to convert this Grid[] object to Graphics[] object so that I can save it as a PDF of desired ImageSize.

Note: I tried to save the output of Grid[] as PDF using Export[]. It works fine. However, when I set ImageSize in Export[], it seems to be ignored.

I tried

i=First@ImportString[ExportString[figure, "PDF"]];

But even this seems to lose clarity but this gives crispier image than Rasterize

I have a figure (which is by combining different plots) that I generated using Grid[]. The problem is, I want to specify the ImageSize of this final figure. I am unable to do it in Grid[]. Therefore, I wanted to convert this Grid[] object to Graphics[] object so that I can save it as a PDF of desired ImageSize.

Note: I tried to save the output of Grid[] as PDF using Export[]. It works fine. However, when I set ImageSize in Export[], it seems to be ignored.

I tried

i=First@ImportString[ExportString[figure, "PDF"]];

But even this seems to lose clarity but this gives crispier image than Rasterize

Magnify[] 

seems to do what I want even if It doesn't convert the figure to graphics, I can change the resolution by trial and error. Not the best way to do it but gets the job done.

edited tags; edited title
Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

how tocan I convert Grid[]a Grid object to a Graphics object?

improved formatting
Source Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751
Loading
Tweeted twitter.com/#!/StackMma/status/363174382233219072
tried ExportString
Source Link
preeti
  • 833
  • 1
  • 7
  • 17
Loading
Source Link
preeti
  • 833
  • 1
  • 7
  • 17
Loading