MathGroup Archive 1992

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

Search the Archive

Thinner lines by default in mma graphics?

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Thinner lines by default in mma graphics?
  • From: twj
  • Date: Sun, 15 Nov 92 11:09:15 CST

>    At the moment I am very fond of a particular
>function, SphericalPlot3D. There is a problem:
>
>    It does not seem to have an option PlotStyle.
>Plot does have PlotStyle option via which I can
>set the line width of the graphic. 

>
>    What methods are there by which I can change the
>line width of SphericalPlot3D? At the moment I am
>changing the PostScript files manually. I have also
>tried the AbsoluteThickness[0.01] to no effect.

SphericalPlot3D is built on-top of ParametricPlot3D.
It plots a function defined in spherical coordinates.
The arguments and options it takes are passed on to 

ParametricPlot3D which generates a Graphics3D object
which is displayed.

I presume that you are plotting a surface and you want
to change the weight of the edges of the polygons which
SphericalPlot3D draws.   If you want to do something
the same mechanism applies.

There are quite a number of ways to do this.  One could
define an option for SphericalPlot3D to do this and
make an amended version of the package.  However probably
the simplest way to fix this is to make a function which
will redisplay a Graphics3D object after adding some
directives to change the appearance.   This can be done
with the following function...

	SetStyle[ Graphics3D[ obj_, opts___], style_] :=
		Graphics3D[ {style, obj}, opts]

	SetStyle[ Graphics3D[ obj_, opts___], style_List] :=
		Graphics3D[ Append[ style, obj], opts]

It could be used as so...

	p = SphericalPlot3D[ 1, {t,0,Pi}, {p,0,2Pi}]
	
	
	Show[
		SetStyle[ p, EdgeForm[ Thickness[ 0.01]]]
	    ]


>    In fact SphericalPlot3D[] missing a lot of
>options. For example it does not have an
>AxesOrigin (which Plot again has), by which I
>can specify the location of the Cartesian
>coordinate system. The Axes -> True gives me
>three lines which do not look like a cartesian
>coordinate system at all. A coordinate system
>immersed with the 3D graphic would be needed. 



The axes which are drawn for the 3D graphics are similar
to Frame axes in 2D graphics.  This means that they go around
the edges of the bounding box of the 3D primitives.  You can
use the AxesEdge option to specify which edges of the box are
used.  One of the advantages of having axes with tick marks and
labels which go around the edge of the 3D image is that this
ensures that the labels do not interfere with the objects which
are drawn.   If you want to have simple line axes inside an
image this can be done.   A function like this will work...

Options[ AddMyAxes] = {AxesOrigin -> {0,0,0}}

AddMyAxes[ g:Graphics3D[ obj_, opts___], opt1___] :=
	Block[{down, up, orgin, axes},
		{down, up} = Transpose[ FullOptions[ g, PlotRange]] ;
		origin = AxesOrigin /. {opt1} /. Options[ Add3DAxes];
		axes = Table[ Line[
				{ReplacePart[ origin, Part[ down, i], i],
 				 ReplacePart[ origin, Part[ up, i], i]}], 

				{i,3}] ;
		Graphics3D[ {axes, obj}, opts]
	]

then 


Show[ AddMyAxes[ p]]

where p is a Graphics3D object,  will display the visible parts of 

three lines inside the bounding box. 



Tom Wickham-Jones
WRI







  • Prev by Date: MathGroup mail archive
  • Next by Date: functional analysis notebook?
  • Previous by thread: Thinner lines by default in mma graphics?
  • Next by thread: Pade Approximations