Question: Creating a 2D plot from a 3D plot


How would you transform a 3D plot structure into a 2D plot structure? I have in mind 1) creating a 3D plot with odeplot or with plot3d, 2) selecting (say) 4 orientations, 3) transforming each into a 2D plot, 4) exporting the 2D plots using the Standard GUI.

The reason behind my question is that the best-looking exported plots that I have been able to obtain with Maple are 2D plots exported as postscript with the Standard GUI. 3D plots don't look nearly as good when exported with the Classic GUI or Command-line Maple.

I don't really know the amount of work required for this, it may be asking for too much. Or maybe not... isn't the inline plot driver already computing the projection? wouldn't there be a way to get that data? Can it be done by extracting the 3D points and using either projection or ProjectionPlot from the Student[LinearAlgebra] package?


Here is an example,

p := plot3d( [ 4+x*cos((1/2)*y), y, x*sin((1/2)*y) ]
  , x = -Pi .. Pi
  , y = 0 .. 2*Pi
  , 'coords' = cylindrical
  , 'style' = patchnogrid
  , 'grid' = [60, 60]
  , 'lightmodel' = light4
  , 'shading' = zhue
  , 'scaling' = constrained
  , 'transparency' = .3
  , 'caption' = [ typeset("3D plot rotated around x-axis by %1", k*Pi/4, ".") ]
  , 'labels' = [`x`, `y`, `z`] # These labels don't display...
) :

# plots:-display(%);

P := seq(
  plottools:-rotate(
    plots:-display( p
      , 'axes' = box
      , 'labels' = [`x`, `y`, `z`] # These labels don't display...
    ) , k*Pi/4, [ [0,0,0], [0,0,1] ]
  ) , k = 1 .. 4
) :

ArraySeqPlot := plots:-display( ArrayTools:-Alias(Array([P]), [round(nops([P])/2), 2], C_order) ):
  plots:-display(%);


Minor problems in the above include: the labels don't appear (they seem to be removed the call to plottools:-rotate); small tweak needed to typeset k*Pi/4 in a more natural way (e.g. Pi over 2 as opposed to 1 over 2 times Pi, this has been discussed many times before on mapleprimes); export the Array for printing (if this is impossible, never mind). The image below is produced by "Print Screen" and pasting into IrfanView...

It would be nice to be able to export the axes and labels too, if feasible.

 

Please Wait...