The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Plot the minimum of several planes in a 3d plot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

origin_newbie

Australia
5 Posts

Posted - 05/10/2018 :  12:14:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I am trying to plot the minimum of several plane in a 3d plot. What I have is a number of planes and basically I want to truncate the planes such that only the plane with the lowest value is shown. The attached figure right clarify my point.

On the right are the planes I have, on the right is what I want to achieve. On the right you can see that the planes have been truncated and only the sections with the lowest values are shown. Is there a way to achieve this in orginlab?

Thanks,
Lexa

Lexa

AmandaLu

439 Posts

Posted - 05/10/2018 :  01:55:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I cannot see your attached figure. Could you please attach it again?

Thanks,
Amanda
OriginLab Technical Service
Go to Top of Page

origin_newbie

Australia
5 Posts

Posted - 05/10/2018 :  02:03:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I have tried using the "insert image", but the image is not showing, here is a link instead:

https://www.dropbox.com/s/tj3ejstejnkbylw/3d_plots_minimum.png?dl=0

Regards,
Lexa
Go to Top of Page

AmandaLu

439 Posts

Posted - 05/10/2018 :  02:16:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The left is what you want and the right is what you have, right?

Thanks,
Amanda
OriginLab Technical Service
Go to Top of Page

origin_newbie

Australia
5 Posts

Posted - 05/10/2018 :  02:21:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Amanda,

Yes the one on the left is what I want to achieve. I just want a way to cut the planes such that only the minimum surfaces are shown.

Thanks,
Lexa
Go to Top of Page

AmandaLu

439 Posts

Posted - 05/10/2018 :  02:27:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can clip the surface this way:

1. Double click on the surface to open the Plot Details dialog. Select Layer1 on the left panel and activate the Miscellaneous tab on the right. Check Enable in Clipping group. Click OK to close the dialog.
2. Double click on the Z axis to open the Axis dialog. Change the From and To on the Scale tab.

Thanks,
Amanda
OriginLab Technical Service
Go to Top of Page

origin_newbie

Australia
5 Posts

Posted - 05/10/2018 :  06:26:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I have tired that but it did not work. Essentially I want something that automatically displays the surface with the minimum over a number of planes. Perhaps this new figure will illustrate more what I want to achieve.

The clipping option allows me to cut at an arbitrary level parts of the surface, but that is not what I want.

https://www.dropbox.com/s/mcxpkdljpq517sr/3d_plot_marked.png?dl=0

Thanks,
Lexa
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 05/10/2018 :  4:59:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Lexa,

You can make a single surface with such condition, and color the surface segments based on the
source plane from an extra matrix. Assuming that you know every plane's parameters (a, b, and c
in z=ax+by+c). you can try the following sample procedure (with 3 planes of z=x, z=y, and z=0.2*x+0.4*y-1) :
1) In Script window, define functions: Plane1, Plane2, ... for your planes, and minpl(x,y) such as:
    function double plane1(double x, double y) { return    1*x+0*y+0; }
    function double plane2(double x, double y) { return    0*x+1*y+0; }
    function double plane3(double x, double y) { return   0.2*x+0.4*y-1; }
    function double minpl(double x, double y) {return min(plane1(x,y),plane2(x,y),plane3(x,y)); }
2) To make the surface, select "File> New> Function Plot> 3D Function Plot" menu, 
     and enter the formula:
        min(plane1(x,y), plane2(x,y), plane3(x,y)) 
    Set the numbers of Mesh Grids reasonably large not to show the Jaggies.
    We get 3 matrices, and you can delete or hide their plots.
3) Press "D" button at top right corner of the matrix, and select "Add" flyout to add an 
     matrix object, and click "2" image thumbnail in the matrix book to select. 
4) For the color values, select "Matrix> Set Values" menu, and enter the coloring formula 
     using nested conditional operators:
        minpl(x,y)==plane1(x,y)?2:(minpl(x,y)==plane2(x,y)?3:4)
     Here, 2, 3, and 4 are color numbers to be distinguished. 
     (The syntax of the conditional operator is <Condition>?<ValueOnYes):<ValueOnNo> )
5) Make a color-mapped 3D surface plot from the original matrix. Double-click it, and 
    open the Plot Details dialog.
6) Under "Fill" tab, turn ON the "Contour Fill from Matrix" radio button, and select our 
    new matrix object (Mat(2)). 
7) Under "Colormap/Contour" tab, press the Pencil icon for the levels, and enter the 
    From=2(minimum color number), To=4(maximum color number).
8) Customize the color scheme. You can modify a single color at a specific level by pressing its 
    corresponding color swatch. Reducing the number of levels would make the customization easier.
    Click OK to complete the plot customization.
Note that if you want to draw the border lines, show all lines in the Colormap/Contours tab, 
or just use the Draw Line tool.




Hope this works.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 05/10/2018 5:03:36 PM
Go to Top of Page

origin_newbie

Australia
5 Posts

Posted - 05/11/2018 :  02:03:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo,

Thanks a lot this is exactly what I want! Your example works great.

I have 7 planes and I have set up the equations and the plot looks correct, but for step 4 I have a problem setting up the coloring of each individual plane using the nested conditional operators.

This is what I have tried:

minpl(x,y)==plane1(x,y)?2:(
minpl(x,y)==plane2(x,y)?3:(
minpl(x,y)==plane3(x,y)?4:(
minpl(x,y)==plane4(x,y)?5:(
minpl(x,y)==plane5(x,y)?6:(
minpl(x,y)==plane6(x,y)?7:8
)))))

But all I am getting is a matrix filled with "8".

Is there a way to fix this?

Thanks,
Lexa

Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 05/11/2018 :  11:50:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Lexa,

As far as I tried, when the expression was written in one line like below, it worked:
minpl(x,y)==plane1(x,y)?2:(minpl(x,y)==plane2(x,y)?3:(minpl(x,y)==plane3(x,y)?4:(minpl(x,y)==plane4(x,y)?5:(minpl(x,y)==plane5(x,y)?6:(minpl(x,y)==plane6(x,y)?7:8)))))
How about your case?

--Hideo Fujii
OriginLab
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000