cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to create a 3d surface/contour plot in prime 2.0

ptc-4699986
1-Newbie

How to create a 3d surface/contour plot in prime 2.0

Hello All,

I have 3 vector for X, Y, Z but I am unable to create a 3d surface plot or contour plot of this in mathcad prime 2.0

I have read somewhere that is is not possible anymore but maybe there is a way to do it.

many thanks for the help.

1 ACCEPTED SOLUTION

Accepted Solutions

One way attached.

Alan

View solution in original post

11 REPLIES 11

One way attached.

Alan

many thanks for your reply, it works great.

I have altered the sheet a little te include my real data and use a contour plot i.s.o 3d surface.

Somehow the colormap is wrong, do you know how to fix that too?

You data ranges from -300 to -40, so you should change the colormap accordingly

See attached

thanks for the help, but in you file the colormap is also wrong.

I have values in the z matrix that are higher than let say -50 and they should be orange according to the colormap. But they are not.

I see what you mean, but this are only about 6 values on the outer right edge. Obviously not making a plane region for Mathcad to shade.

Maybe you get a better looking plot using a spline interpolation of your surface.

After playing around with the sheet a while I agree, that the behaviour of the colormapping is at least not reasonable to me, too. I wouldn't call it a bug yet as maybe its just because of the coarse grid - we only have a 4*25 data table.

Find attached a version which uses a spline interpolated function from your data table - think it looks better.

many thanks for the interpolation hint.

haha we where working on it at the same time.

I see you also came up with a solution.

I added a function which uses Bicubic2D to create the new interpolated surface and it seems to work.

or is it not meant to be used for this?

Bicubic2D seems to be exactly meant for this. From the description it looks like it does pretty much the same as my routine, but with a prebuilt command. You may like to compare two plots done with my routine and bicubic2D - I haven't done it but I guess there would be no difference.

Bicubic2D is new in Prime and I was not aware of its existence - I'm a Mathcad 15 user and I plan to stay with that version as long as possible, as Prime is not really a full fledged alternative at the time being. But sometimes one is able to discover an advantage.

Bicubic2D does seem to do the same but with a linear interpolation.

I checked it by changing you routine from cspline into lspline and the results where identical.

Many thanks again for the help

Arjen Walstra wrote:

Bicubic2D does seem to do the same but with a linear interpolation.

I checked it by changing you routine from cspline into lspline and the results where identical.

Many thanks again for the help

Good to know, but why is that method called biCUBIC then?

I don't know why they call it BiCubic2D.

this is what they say in the help file:

"The Bicubic2D function is equivalent to using lspline in two dimensions, with no restrictions on the number of rows and columns of the input values. To obtain a value for a new point, Bicubic2D interpolates down each column of the Z matrix, creating a new row. It then interpolates across the new row. "

Top Tags