MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Graphics package in v6

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78428] Re: Graphics package in v6
  • From: Helen Read <hpr at together.net>
  • Date: Sun, 1 Jul 2007 07:45:49 -0400 (EDT)
  • References: <f65aq2$9jg$1@smc.vnet.net>
  • Reply-to: HPR <read at math.uvm.edu>

Jaccard Florian wrote:
> Dear group,
> 
> I'm a convinced Mathematica user, I love the new features I discover
> in v6, but I think the Graphics package was very useful in v5 and I'm
> missing it.
> 
> For example, it was very easy to obtain the 3D plot of a surface of
> revolution around the x-axis with SurfaceOfRevolution.
>
> Let us take the revolution of y=x^2 around the x-axis :
> 
> << "Graphics`"
> SurfaceOfRevolution[x^2, {x, 0, 2}, RevolutionAxis -> {1, 0, 0}]
> 
> Not possible without cheating if using RevolutionPlot3D, isn't it=A0?

I posted several weeks ago about the lack of an option for setting the 
revolution axis in RevolutionPlot3D, and someone from Wolfram (I forget 
who) replied that they will look into it and most likely add it in a 
future release.

In the meantime, you can use the following workaround, which I showed my 
Calculus II students yesterday when we started the unit on volumes of 
solids of revolution. Some of them are complete Mathematica newbies (the 
class just started this past week), and they didn't have any problem 
with it.

Here's what I had them do. To revolve say, y=x^2 around the y-axis, just 
use RevolutionPlot3D on the ordered pair {x,x^2}. (We are essentially 
using a parametric representation for the curve, which I found sets the 
BoxRatios more to my liking than just using the function by itself.)

RevolutionPlot3D[{x,x^2},{x,0,2}]

To revolve the same curve around the x-axis, reverse the ordered pair 
and flip the axes around by setting ViewVertical.

RevolutionPlot3D[{x^2,x},{x,0,2},ViewVertical->{-1,0,0}]

We would actually define a function for x^2 (or whatever) first, and use 
{x,f[x]} when revolving around y-axis and {f[x],x} for revolving around 
the x-axis. The ordered pair idea also makes it simple to revolve 
functions in the form x=f(y) around either axis, using {f[y],y} or 
{y,f[y]} depending on the direction.

I hope that WRI will add a RevolutionAxis option to RevolutionPlot3D 
soon, but the above works OK in the meantime, and the graphs are so much 
better looking than they were in 5.2, and we can spin them around with 
the mouse without having to load any packages.

> Or you could have a nice plot of implicit functions, with the ticks
> on  the x- and y-axis, using ImplicitPlot...
>
> Example :
> 
> << "Graphics`"
> ImplicitPlot[x^3*y + x*y^3 == 2, {x, -3, 3}, {y, -3, 3}]
> 
> Not possible using CountourPlot without cheating, isn't it?
> 
> (I consider the following as cheating :
> Show[Plot[0, {x, -3, 3}, PlotRange -> {-3, 3},
>   AspectRatio -> Automatic],
>    ContourPlot[x^3*y + x*y^3 == 2, {x, -3, 3}, {y, -3, 3},
>   Axes -> True,
>      AxesOrigin -> {0, 0}, PerformanceGoal -> "Quality",
>   PlotPoints -> 150]]
> )

I'm not sure what your objection is to

ContourPlot[x^3 y + x y^3==2,{x,-3,3},{y,-3,3}]

or

ContourPlot[x^3 y + x y^3==2,{x,-3,3},{y,-3,3},Frame->False,Axes->True]

if you'd rather have Axes instead of a Frame.

To me the graph looks much smoother (with the new anti-aliasing 
graphics) than

ImplicitPlot[x^3 y + x y^3==2,{x,-3,3},{y,-3,3}] in 5.2.

-- 
Helen Read
University of Vermont


  • Prev by Date: Re: Re: Mathematica code for survival functions
  • Next by Date: Re: Coloring 3D-surfaces
  • Previous by thread: Re: Graphics package in v6
  • Next by thread: RE: Re: Graphics package in v6