Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sorry I am not sure if I got anything wrong with this version of Mathematica and Mac OS X i am running. But every time I export a 3D graph, to png or tiff, I lost the view angle, view vector viewpoint information immediately. To let you know what I meant, here is a simple code:

I typed:

x = RevolutionPlot3D[Sqrt[((t/5)^2 - 1)*2], {t, 5, 20}]

And I got a plot


Original Plot

Then I manually rotate the plot so that it looks better, for example like this: Manually rotated view

Ok, now, I used Export to export it to png:

Export["test.png", %];

What I got is pathetically, the un-rotated png plot!: Exported png

This is driving me crazy and dead.. I also tried to set Viewpoint and view vector, stuff to the code, it doesn't work for me either. I also tried Export["test.png",x] too, no luck. I understand I could easily right-click to save, But I need a background-none option to make the graph transparent..

Can any one confirm (this bug?) or i am doing something stupidly wrong? I checked the documentation and googled for 1 hour, nothing found.

So the question is, how can I export the graph as it is shown on the notebook (if I can not, then what's the point of allowing us to rotate it..)

share|improve this question
RightClick + Save Graphics As... or File/Save Selection As... or Export["test.png", actual graphics] – Kuba Apr 9 '14 at 9:10
You need to Export the actual rotated graphics or set the view options specifically. x is not changed by you rotating its graphical avatar. Related: – Yves Klett Apr 9 '14 at 9:24
What did you mean by this? - "PS. I will be grateful like a dead man if Mathematica support plot tools like Matlab." – Vitaliy Kaurov Apr 9 '14 at 9:33
@VitaliyKaurov yes, this sentence is somewhat open to interpretation :D – Yves Klett Apr 9 '14 at 9:45
You have two good answers so I'll just comment to emphasise that % does not refer to the contents of the last output cell, it refers to the last output expression from the kernel. Nothing you do to the output cell changes the expression stored in %, whether it's rotating the graphics or even deleting it entirely and replacing it with a photo of your cat. – Simon Woods Apr 9 '14 at 12:22
up vote 9 down vote accepted

What is stored in variable x is different from rotated object you have in output cell. You rotated - so you changed the properties. Many ways to do this - so in addition to comments' methods...

1) In-Export rotation

enter image description here

2) Seeing options

enter image description here

Export["test.png", Show[x, opts]]
share|improve this answer
OP may be confused because he is not using x but %. – Kuba Apr 9 '14 at 9:35
@Kuba yes, good point, I hope he reads comments ;-) – Vitaliy Kaurov Apr 9 '14 at 9:36
Hi @Kuba thanks so much. I actually tried to export x directly, the result is the same (un-rotated png)~ I will try to copy the output to export to see thanks! – bboczeng Apr 9 '14 at 17:51
In Export-Rotation works for me! – bboczeng Apr 9 '14 at 18:05

To save a PNG of a plot or graphics expression, I avoid Export. I select the displayed output and click on the Save Selection As ... item on the File menu. This will save the selected output exactly as it appears on the display.


share|improve this answer
Hi @m_goldberg . The reason I wanted to use export is to make the background transparent. ! Save as can not make the background transparent. Thanks for your answer! – bboczeng Apr 9 '14 at 17:52
also export can make the figure much better by setting ImageResolution->500 or so. – bboczeng Apr 9 '14 at 18:12

Your Answer


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.