Re: [Plplot-general] surface plot questions

2018-03-21 Thread Alan W. Irwin

On 2018-03-21 18:47-0400 David Bergman wrote:


Alan,

Thanks for the reply.  MATLAB and SCILAB functions are overloaded to allow to 
this.  For example the following figures were generated by such a call to 
surf(x,y,z), with x, y, and z each a n-by-n matrix.


I believe this causes the function to trace curves of constant u and v, 
though I am not sure.  I use it to make 3-dim cardioid patterns.


I believe the following wound work (with some mods).

u = linspace(min,max,n);

[U,V] = meshgrid(u,u);

define some functions.

X(U,V), Y(U,V), Z(U,V)

then

surf(X,Y,Z).

if u and v are theta and phi in spherical coordinates, then sin(Th).*cos(Ph), 
sin(Th).*sin(Ph), cos(Th) would generate the unit sphere.


Hi David:

Cool plots!

And I just realized we could produce something like those with
.
For an example that uses calls to plpoly3 to plot a unit sphere, see
.  It should be
possible (but likely not trivial) to modify that example to plot something more
interesting than the unit sphere, and with a convenient API, e.g.,

void
plmeshxyz(PLINT nx, PLINT ny, PLINT nz, PLFLT_MATRIX x, PLFLT_MATRIX
PLFLT_MATRIX z);

where plmeshxyz calls plpoly3 appropriately inside.

I haven't looked at the details of what would be required, but if you
do have success with this type of approach, we will likely ask you to
donate your work to PLplot under the LGPL so others can benefit.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general


Re: [Plplot-general] surface plot questions

2018-03-21 Thread David Bergman

Alan,

Thanks for the reply.  MATLAB and SCILAB functions are overloaded to 
allow to this.  For example the following figures were generated by such 
a call to surf(x,y,z), with x, y, and z each a n-by-n matrix.


I believe this causes the function to trace curves of constant u and v, 
though I am not sure.  I use it to make 3-dim cardioid patterns.


I believe the following wound work (with some mods).

u = linspace(min,max,n);

[U,V] = meshgrid(u,u);

define some functions.

X(U,V), Y(U,V), Z(U,V)

then

surf(X,Y,Z).

if u and v are theta and phi in spherical coordinates, then 
sin(Th).*cos(Ph), sin(Th).*sin(Ph), cos(Th) would generate the unit sphere.


Thanks,
David




On 3/20/2018 10:09 PM, Alan W. Irwin wrote:

On 2018-03-20 17:05-0400 David Bergman wrote:


All,

I am interested in making a surface plot in 3-dim of a parameterized 
surface in the following format,

x(u,v), y(u,v), z(u,v)
rather than the usual z = f(u,v).

MATLAB, SCILAB, and Octave have this option and I was wondering if 
PLplot has it as well.
I did look through the examples and documented interfaces and nothing 
seemed to match this.




Hi David:

Our plcont and plshades API's have this capability, see
 and
,
but our other means of making 3D plots, e.g., plmesh (see

for the full list of our 3D API's) have only one-dimensional x and y 
arguments.


By the way, can you give me an example of, say, a mesh plot of a
parameterized surface?  I thought such plots required one-dimensional
x and y vectors since the results are typically a collection of 3D
lines, z(y)_i, at a fixed set of one-dimensional x_i values and
another set of 3D lines, z(x)_j, at a fixed one-dimension set of y_j
values.  In fact, all the MATLAB examples I have just looked up of
mesh plots seem to be of this type.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and 
Astronomy,

University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__





---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general