Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Export a graphical plot to pdf file
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Szymon Roziewski  
View profile  
 More options Nov 7 2012, 12:59 am
Newsgroups: comp.soft-sys.math.mathematica
From: Szymon Roziewski <szymon.roziew...@gmail.com>
Date: Wed, 7 Nov 2012 05:57:52 +0000 (UTC)
Local: Wed, Nov 7 2012 12:57 am
Subject: Export a graphical plot to pdf file

Hi there,

I have a ContourPlot result which I need to put into pdf file.
The problem is that the filled area is in a mess, I mean there are lots of
thin white stripes on it.

For example, please try out this bunch of code

gr = ContourPlot[x^2 + y^2, {x, -1, 1}, {y, -1, 1}];
Export["file.pdf", gr]

Best regards,
Szymon Roziewski


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Szymon Roziewski  
View profile  
 More options Nov 7 2012, 1:00 am
Newsgroups: comp.soft-sys.math.mathematica
From: Szymon Roziewski <szymon.roziew...@gmail.com>
Date: Wed, 7 Nov 2012 05:58:02 +0000 (UTC)
Local: Wed, Nov 7 2012 12:58 am
Subject: Re: Export a graphical plot to pdf file

Hello,

I've found such a suggestion

antialias[g_] :=
 ImageResize[
  Rasterize[g, "Image", ImageResolution -> 600, Background -> White],
  Scaled[2]]
g = ContourPlot[x^2 + y^2, {x, -1, 1}, {y, -1, 1}];
img = antialias[Show[g, Axes -> False, Boxed -> False]];
Export["file.pdf", img, "AllowRasterization" -> False]

But the background is lightred although I set it up to be white.

Bes wishes,
Szymon Roziewski

On 6 November 2012 16:03, Szymon Roziewski <szymon.roziew...@gmail.com>wrote:

--
Z wyrazami szacunku,
Szymon Roziewski

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nasser M. Abbasi  
View profile  
 More options Nov 8 2012, 7:05 pm
Newsgroups: comp.soft-sys.math.mathematica
From: "Nasser M. Abbasi" <n...@12000.org>
Date: Fri, 9 Nov 2012 00:03:26 +0000 (UTC)
Local: Thurs, Nov 8 2012 7:03 pm
Subject: Re: Export a graphical plot to pdf file
On 11/6/2012 11:57 PM, Szymon Roziewski wrote:

> Hi there,

> I have a ContourPlot result which I need to put into pdf file.
> The problem is that the filled area is in a mess, I mean there are lots of
> thin white stripes on it.

> For example, please try out this bunch of code

> gr = ContourPlot[x^2 + y^2, {x, -1, 1}, {y, -1, 1}];
> Export["file.pdf", gr]

> Best regards,
> Szymon Roziewski

Do not know much about this, but trying few things, I found this
to produce good image in the PDF file (no  white stripes on it)

---------------------------
gr = ContourPlot[x^2 + y^2, {x, -1, 1}, {y, -1, 1}]
Export["file.pdf", Rasterize[gr, ImageResolution -> 128]]
--------------------------------

You can change the options to Rasterize to see which gives
you best image in the PDF.

To obtain more information on the pdf file generated by
the export, you can list the Elements. something like:

---------------------------
lis = Import["file.pdf", "Elements"]
Grid[
  Table[{lis[[i]], Import["file.pdf", lis[[i]]]}, {i, 1, Length[lis]}],
   Frame -> All]
------------------------------

Another thing to try is to issue the command

SetOptions[$FrontEndSession, PrintingStyleEnvironment -> "Working"]

first before exporting. Again, this is something to try.
But the Rasterize'd image in PDF do not have the white stripes
any more.

--Nasser


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin J. McCann  
View profile  
 More options Nov 10 2012, 2:11 am
Newsgroups: comp.soft-sys.math.mathematica
From: "Kevin J. McCann" <k...@KevinMcCann.com>
Date: Sat, 10 Nov 2012 07:09:41 +0000 (UTC)
Local: Sat, Nov 10 2012 2:09 am
Subject: Re: Export a graphical plot to pdf file
I have not done this; however, I frequently print out entire notebooks
as PDF's, and they appear fine. You could do that and then cut and paste
the PDF version of the plot. Just a suggestion.

Kevin

On 11/8/2012 7:03 PM, Nasser M. Abbasi wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RBaillie  
View profile  
 More options Nov 10 2012, 2:11 am
Newsgroups: comp.soft-sys.math.mathematica
From: RBaillie <bobbail...@frii.com>
Date: Sat, 10 Nov 2012 07:09:51 +0000 (UTC)
Local: Sat, Nov 10 2012 2:09 am
Subject: Re: Export a graphical plot to pdf file
Unfortunately, exporting to pdf has not worked properly since version
5.2.  This export works fine in 5.2.

  gr = ContourPlot[x^2 + y^2, {x, -1, 1}, {y, -1, 1}];
  Export["file.pdf", gr]

Moreover, the file created with version 5.2 is far smaller than with
later versions.

Often, using the
  "AllowRasterization" -> False
option greatly improves exports to pdf with version 8, but it does not
work in this case.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristjan Kannike  
View profile  
 More options Nov 10 2012, 3:32 am
Newsgroups: comp.soft-sys.math.mathematica
From: Kristjan Kannike <kkann...@ut.ee>
Date: Sat, 10 Nov 2012 08:30:47 +0000 (UTC)
Local: Sat, Nov 10 2012 3:30 am
Subject: Re: Export a graphical plot to pdf file
Hello,

The problem is that ContourPlot, DensityPlot etc. compose their plot of
lots of tiny polygons. PDF is a vector format and preserves them all. The
PDF file becomes large and loads and scrolls slowly.

There is a FixPolygons package that merges polygons of the same colour
that results in drastically reduced PDF size:

https://github.com/wspr/mmapkg

This works well with ContourPlot. Unfortunately not so well (sometimes)
with DensityPlot as its polygons are filled with gradients, not one
colour.

Best,
Kristjan Kannike


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Szymon Roziewski  
View profile  
 More options Nov 13 2012, 12:17 am
Newsgroups: comp.soft-sys.math.mathematica
From: Szymon Roziewski <szymon.roziew...@gmail.com>
Date: Tue, 13 Nov 2012 05:15:00 +0000 (UTC)
Subject: Re: Export a graphical plot to pdf file
Thank you all for your help.

This solution works almost well

antialias[g_] :=
 ImageResize[
  Rasterize[g, "Image", ImageResolution -> 600, Background -> White],
  Scaled[2]]

g = ContourPlot[x^2 + y^2, {x, -1, 1}, {y, -1, 1}];
img = antialias[Show[g, Axes -> False, Boxed -> False]];
Export["file.pdf", img, "AllowRasterization" -> False]

I mean the problem is with its background that is light red but it should
be white.

Best wishes,
Szymon Roziewski

On 12 November 2012 12:06, Szymon Roziewski <szymon.roziew...@gmail.com>wrote:

--
Z wyrazami szacunku,
Szymon Roziewski

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »