Register to reply

Problem with ParametricPlot3D in Mathematica

by Barnak
Tags: mathematica, parametricplot3d
Share this thread:
Feb7-12, 01:53 PM
P: 61
I'm having an output quality problem with ParametricPlot3D in Mathematica 7.

I need to show a complicated curve found by numerical integration of a differential equation (using NDSolve), and export the curve's graphic (from ParametricPlot3D) to PDF, so I can use it in another application. I know how to do it, and it's working, but the curve is having a very crude aspect (straight lines, instead of a smooth curve, or some parts of the curve aren't right).

Of course, I could add the option PlotPoints-> 5000 to smooth the curve (4000 or less isn't enough, apparently), but this gives a huge PDF file (about 10 MB for a simple vectorial graphic), and it's useless for what I need to do with it.

The exact same code in Mathematica 4 (which I don't have access anymore) didn't gave me the problem at all : I got a nicely looking curve which could be exported into a small PDF file. So I don't understand what is happening here with Mathematica 7.

Do I need to add some special directives to the ParametricPlot3D, to get an optimised smooth curve, without having to add something like PlotPoints -> 5000 ?
Phys.Org News Partner Science news on
Climate change increases risk of crop slowdown in next 20 years
Researcher part of team studying ways to better predict intensity of hurricanes
New molecule puts scientists a step closer to understanding hydrogen storage
Bill Simpson
Feb9-12, 10:38 PM
P: 1,028
Instead of PlotPoints-> 5000 try MaxRecursion->somenumber, and without your curve I can't even guess where you might start. The default for MaxRecursion is Automatic and it appears that some part of your curve is sufficiently convoluted that it bails out before getting the detail you want.

MaxRecursion should enable it to spend more work on the convoluted parts without needing to have vast numbers of points on the smooth parts. Look up MaxRecursion in the help system and in ParametricPlot3D to get limited information on how this works. Start slowly and see how it behaves as you increment it.

You can also turn on informative messages about it not being able to achieve sufficient smoothness with On[ParametricPlot3d:accbend]. This can give you some idea when it cannot accomplish what it thinks you are asking for.
Feb10-12, 11:08 AM
P: 61
Thanks, this may help.

I already used the MaxRecursion option however. It helps in some cases, but not always.

Bill Simpson
Feb10-12, 06:47 PM
P: 1,028
Problem with ParametricPlot3D in Mathematica

Quote Quote by Barnak View Post
I already used the MaxRecursion option however. It helps in some cases, but not always.
Fiddle with the interaction between PlotPoints and MaxRecursion, with the message turned on to see when it believes it cannot find a smooth enough curve and see if you can find an acceptable setting. Choose small specific complicated parts of your curve and watch how those two options interact. PlotPoints should give fixed spacing between the points, no matter how smooth or complicated the curve is at some position. MaxRecursion should enable more or less subdivision between points, more near positions where the curve is complicated.

A completely different approach, I vaguely recall a pdf-optimizer that would eat a large inefficient pdf and emit a very similar appearing but far smaller pdf, but that was many many years ago and I may be incorrect.

Or I suppose you could consider writing code that would generate exactly the curve you desire, based on your knowledge of the curve and the demands you have.

Register to reply

Related Discussions
Problem with mathematica - i am new to this Math & Science Software 5
Mathematica problem Math & Science Software 0
Mathematica Problem, please help me! Math & Science Software 2
Problem with mathematica Math & Science Software 0
Mathematica 5.0 problem Math & Science Software 1