## Re: [Plplot-general] Plotting in 3D...?!

 Re: [Plplot-general] Plotting in 3D...?! From: Hazen Babcock - 2008-01-20 00:37:40 ```On Jan 19, 2008, at 6:00 PM, Oliver Bandel wrote: > Zitat von Oliver Bandel : > > [...] >> >> But how do I set up the environment, and which plotfunctions to use? >> >> > [...] > > OK, I found something in the documentation and the example-code. > > When I use plenv() to set up the 2D grafics and then > use pklw3d() and plbox3() I have the 3D-graphics > activated, but I have the 3D axes as well as a 2D axes > in the picture. > When I throw out plenv() I have a blank page, even when using plvpor() > and plwind(). I usually start from something like example 8 or example 28. Then fiddle around, more or less by trial and error until the plot looks right. Basically you need the following commands (in this order): (1)plvpor() - This sets up how much of the window is to be used for drawing the plot (range 0.0 - 1.0), i.e. the viewport. For example plvpor(0.1,0.9,0.1,0.9) means the graph will be drawn between 10% of the way across the window and 90% of the way across in both x and y. (2)plwind() - This sets up the coordinates of the graph inside the viewport. For example plwind(-1.0, 1.0, -0.9, 1.1) means that a point at (-1.0, -0.9) will be drawn in the lower left hand corner of the viewport. You adjust this range for 3D plots to move the plot up and down (or left and right) in the window. Points in 3D space are mapped using the x,y and z ranges and the two view angles to 2D space and are then drawn. (3)plw3d() - This sets up the coordinates for the 3D graph itself. You can use this to set the x,y and z ranges as well as the viewing angle but this will not change where the graph is drawn on the screen nor the size of the graph. It tells PLplot how to convert from a 3D coordinate to the 2D coordinate space of plwind(). (3)plbox3() - This will draw the axises and the labels. It has good defaults, but if you want more control of the labels then you can use plmtex3 to do your own custom labeling. (4)some drawing commands. It sounded like you wanted to draw lines so you might look at plline3(). -Hazen ```

### Thread view

 [Plplot-general] Plotting in 3D...?! From: Oliver Bandel - 2008-01-19 16:36:40 ```Hello, how to plot in 3D? I want to draw many plots parameterized. One straight-lined curve of (x,y)-points, then the next straight-lined curve of (x,y)-points, and the next... ...so that I have many such plots in one graphic-file, in a 3D-view. And there must be text at the axis (but for that I asked already and think I will get it done). But how do I set up the environment, and which plotfunctions to use? TIA, Oliver ```
 Re: [Plplot-general] Plotting in 3D...?! From: Oliver Bandel - 2008-01-19 23:00:27 ```Zitat von Oliver Bandel : [...] > > But how do I set up the environment, and which plotfunctions to use? > > [...] OK, I found something in the documentation and the example-code. When I use plenv() to set up the 2D grafics and then use pklw3d() and plbox3() I have the 3D-graphics activated, but I have the 3D axes as well as a 2D axes in the picture. When I throw out plenv() I have a blank page, even when using plvpor() and plwind(). Possibly I have only wrong parameters so that the 3D-stuff is located somewhere else but not in the viewable area. Where is it explained, what is called world-coordinates and user coordinates? It's used very often in the documentation, but I have not found an explanatory text that describes the concepts in general, before applying them in the documentation. When I used plenv() to get a viewable axis in my output, the (x,y,z) = (0,0,0) of that 3D-axis is located somehwere beyond the viewable area, so that I only see the top of that graphics. How can I translate the 3D stuff to the middle of the graphics? TIA, Oliver ```
 Re: [Plplot-general] Plotting in 3D...?! From: Hazen Babcock - 2008-01-20 00:37:40 ```On Jan 19, 2008, at 6:00 PM, Oliver Bandel wrote: > Zitat von Oliver Bandel : > > [...] >> >> But how do I set up the environment, and which plotfunctions to use? >> >> > [...] > > OK, I found something in the documentation and the example-code. > > When I use plenv() to set up the 2D grafics and then > use pklw3d() and plbox3() I have the 3D-graphics > activated, but I have the 3D axes as well as a 2D axes > in the picture. > When I throw out plenv() I have a blank page, even when using plvpor() > and plwind(). I usually start from something like example 8 or example 28. Then fiddle around, more or less by trial and error until the plot looks right. Basically you need the following commands (in this order): (1)plvpor() - This sets up how much of the window is to be used for drawing the plot (range 0.0 - 1.0), i.e. the viewport. For example plvpor(0.1,0.9,0.1,0.9) means the graph will be drawn between 10% of the way across the window and 90% of the way across in both x and y. (2)plwind() - This sets up the coordinates of the graph inside the viewport. For example plwind(-1.0, 1.0, -0.9, 1.1) means that a point at (-1.0, -0.9) will be drawn in the lower left hand corner of the viewport. You adjust this range for 3D plots to move the plot up and down (or left and right) in the window. Points in 3D space are mapped using the x,y and z ranges and the two view angles to 2D space and are then drawn. (3)plw3d() - This sets up the coordinates for the 3D graph itself. You can use this to set the x,y and z ranges as well as the viewing angle but this will not change where the graph is drawn on the screen nor the size of the graph. It tells PLplot how to convert from a 3D coordinate to the 2D coordinate space of plwind(). (3)plbox3() - This will draw the axises and the labels. It has good defaults, but if you want more control of the labels then you can use plmtex3 to do your own custom labeling. (4)some drawing commands. It sounded like you wanted to draw lines so you might look at plline3(). -Hazen ```
 Re: [Plplot-general] Plotting in 3D...?! From: Oliver Bandel - 2008-01-20 16:12:56 ```Zitat von Hazen Babcock : > > On Jan 19, 2008, at 6:00 PM, Oliver Bandel wrote: > > > Zitat von Oliver Bandel : > > > > [...] > >> > >> But how do I set up the environment, and which plotfunctions to > use? > >> > >> > > [...] > > > > OK, I found something in the documentation and the example-code. > > > > When I use plenv() to set up the 2D grafics and then > > use pklw3d() and plbox3() I have the 3D-graphics > > activated, but I have the 3D axes as well as a 2D axes > > in the picture. > > When I throw out plenv() I have a blank page, even when using > plvpor() > > and plwind(). > > I usually start from something like example 8 or example 28. Then > fiddle around, more or less by trial and error until the plot looks > right. > > Basically you need the following commands (in this order): > > (1)plvpor() - This sets up how much of the window is to be used for > drawing the plot (range 0.0 - 1.0), i.e. the viewport. For example > plvpor(0.1,0.9,0.1,0.9) means the graph will be drawn between 10% of > the way across the window and 90% of the way across in both x and y. [...] OK, now I have my 3D-Data Diagram. :-) But I had to use pladv(), otherwise plplot-lib gave me a message that I have to use this function or plenv and created no output. Do you have an idea, how to make the axis "grid-like"? I looked at http://plplot.sourceforge.net/examples/demo08.php and possibly I can find the solution there. In that example I found the function plAlloc2dGrid(), which is NOT documented in http://plplot.sourceforge.net/docbook-manual/plplot-html-5.8.0/index.html Any idea on where to get a complete documentation? Ciao, Oliver ```
 Re: [Plplot-general] Plotting in 3D...?! From: Hazen Babcock - 2008-01-20 16:37:48 ```On Jan 20, 2008, at 11:12 AM, Oliver Bandel wrote: > Zitat von Hazen Babcock : >> I usually start from something like example 8 or example 28. Then >> fiddle around, more or less by trial and error until the plot looks >> right. >> >> Basically you need the following commands (in this order): >> >> (1)plvpor() - This sets up how much of the window is to be used for >> drawing the plot (range 0.0 - 1.0), i.e. the viewport. For example >> plvpor(0.1,0.9,0.1,0.9) means the graph will be drawn between 10% of >> the way across the window and 90% of the way across in both x and y. > [...] > > > OK, now I have my 3D-Data Diagram. :-) > > But I had to use pladv(), otherwise plplot-lib gave me a message > that I have to use this function or plenv and created no output. > > > Do you have an idea, how to make the axis "grid-like"? Sorry, I'm not really sure what you mean by more "grid-like". PLplot has a function called plgriddata() that will let you grid irregularly spaced data for the purposes of plotting it. It is documented and there are examples of its use in example 21. > I looked at > http://plplot.sourceforge.net/examples/demo08.php > and possibly I can find the solution there. If you have the PLplot source, the code for all the examples can be found in the examples directory, with sub-directories for each of the different supported languages. > In that example I found the function > plAlloc2dGrid(), which is NOT documented in > http://plplot.sourceforge.net/docbook-manual/plplot-html-5.8.0/ > index.html > > Any idea on where to get a complete documentation? The manual is the only documentation that I know of. -Hazen ```
 Re: [Plplot-general] Plotting in 3D...?! From: Oliver Bandel - 2008-01-20 17:09:51 ```Zitat von Hazen Babcock : [...] > > Do you have an idea, how to make the axis "grid-like"? > > Sorry, I'm not really sure what you mean by more "grid-like". PLplot > has a function called plgriddata() that will let you grid irregularly > spaced data for the purposes of plotting it. It is documented and > there are examples of its use in example 21. [...] With that I mean, that the ticks (main ticks) are elongated, so that the x- y- and z-axis is translated parallel. Then it is easier to see the values of the data in 3D-projection. Something like drawing a 3D-bounding-box cube around the area that is displayed... I hope these words are more easy to understand. I have not found a documented option for that for plbox3(), where I had awaited it to find. Something like 3D-ticks / elongated ticks. Ciao, Oliver ```
 Re: [Plplot-general] Plotting in 3D...?! From: Hazen Babcock - 2008-01-21 04:03:48 Attachments: Message as HTML ```On Jan 20, 2008, at 12:09 PM, Oliver Bandel wrote: > Zitat von Hazen Babcock : > > [...] >>> Do you have an idea, how to make the axis "grid-like"? >> >> Sorry, I'm not really sure what you mean by more "grid-like". PLplot >> has a function called plgriddata() that will let you grid irregularly >> spaced data for the purposes of plotting it. It is documented and >> there are examples of its use in example 21. > [...] > > With that I mean, that the ticks (main ticks) are elongated, > so that the x- y- and z-axis is translated parallel. > > Then it is easier to see the values of the data in 3D-projection. > > Something like drawing a 3D-bounding-box cube around the area > that is displayed... > > > I hope these words are more easy to understand. > > I have not found a documented option for that for plbox3(), > where I had awaited it to find. > > Something like 3D-ticks / elongated ticks. Maybe you are looking for something like plsmaj()/plsmin()? -Hazen ```
 Re: [Plplot-general] Plotting in 3D...?! From: Oliver Bandel - 2008-01-21 10:49:00 ```Zitat von Hazen Babcock : [...] > > Maybe you are looking for something like plsmaj()/plsmin()? [...] Oh, yes, that's going into the right direction. But I want to have the long ticks only on the back-side of the cube, not in front, because this blocks the view on the data itself (and looks like a cage then ;-)). (Using negative values expands in the wrong direction, so possibly a thing like a plsmaj2() and plsmin3() must be there? Or do I have to draw the lines by myself with plline3()? Ciao, Oliver ```
 Re: [Plplot-general] Plotting in 3D...?! From: Oliver Bandel - 2008-01-21 10:52:00 ```Zitat von Oliver Bandel : > Zitat von Hazen Babcock : > [...] > > > > Maybe you are looking for something like plsmaj()/plsmin()? > [...] > > Oh, yes, that's going into the right direction. > But I want to have the long ticks only on the back-side > of the cube, not in front, because this blocks the view > on the data itself (and looks like a cage then ;-)). > > (Using negative values expands in the wrong direction, > so possibly a thing like a plsmaj2() and plsmin3() ^ \ 3 Ciao, Oliver ```