Message Boards Message Boards

PlotStyle->Transparent and rendering as a PDF?

Posted 8 years ago

The following code works fine in Mathematica (produces an expected result):

Plot[-(x + 3)^2 + 2, {x, -10, 10},
 PlotRange -> {-10.1, 10.1}, PlotStyle -> Transparent,
 AspectRatio -> 1, ImageSize -> 350]

but when Print->Open PDF in Preview is invoked, the following results:

enter image description here

I'm using v10.4.1.0 on a OS X v10.11.2

POSTED BY: Andrew
5 Replies

Hi it works for me. Windows 7, MM 10.1

update: Not completely true. When I use print (whole document instead of only the plot) I get an error message. However when I use the File-Save-as option and save the file as PDF it does work. Added PDF.

enter image description here

enter image description here

Attachments:
POSTED BY: l van Veen
Posted 8 years ago

It seems the issue is more complicated: when creating a completely new Mathematica notebook both PlotStyle->Transparent and PlotStyle->Opacity[0] both work fine when creating a PDF. However, when I work with my original notebook, the PDF is still not properly distilled (in fact, it can crash Mathematica when the PDF is being rendered).

Unfortunately for me, the notebook I'm using is a collection of quizzes, so if it's an issue with the corruption of the notebook I'm really doomed and will have to live with the issue somehow.

I've attached the notebook that fails (with just the lines of code I originally provided), perhaps someone can determine how it became corrupted.

Attachments:
POSTED BY: Andrew

Oh sorry I did not understand your cuestion however its not a bug if you put it Transparent its going to have 0 opacity if you want to edit that you have to edit the value of opacity your code is the same as

Plot[-(x + 3)^2 + 2, {x, -10, 10}, PlotRange -> {-10.1, 10.1}, 
PlotStyle -> Opacity[0], AspectRatio -> 1, ImageSize -> 350]

To change that you have to put something like

Plot[-(x + 3)^2 + 2, {x, -10, 10}, PlotRange -> {-10.1, 10.1}, 
 PlotStyle -> Opacity[0.3], AspectRatio -> 1, ImageSize -> 350]

or something like that

POSTED BY: Hansel Montuffar
Posted 8 years ago

The original question in the subject line was more along the lines: Is this a bug? While I understand removing it solves the problem, but it also makes the curve appear, which I don't want to do (I'm creating a paper-based graphing quiz on quadratics: I first plot the equations and then size the grid properly and then I simply want the curves to disappear while keeping the equations intact for creating an answer key).

Remember: it works fine within Mathematica (no errors): the problem only appears when trying to produce the PDF.

POSTED BY: Andrew

Take off the PlotStyle-> Transparent

POSTED BY: Hansel Montuffar
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract