Creating a 3D Surface Plot with Profile Lines

Note: Starting with Origin 2016, you can now do the same thing I outline in this post with with one of our Apps – 3D Wall Profile. In fact, the App makes it much, much easier to do (and has more options) than the method presented in this blog post. For Origin 2015 users, you may read on if you wish to create this graph.

 

In this post, we will learn how to add “profile lines” to a 3D Colormap Surface Plot by “projecting” them into the side planes of the graph.chd_graph_finished_no_win

 

 

Note: This post and project was created using Origin 2015. Some of the features may not work the same in earlier versions of Origin.

 

If you’d like to follow along, download the zip file 3D Surface with Profile Lines and open the OPJ. Finished graphs are available in the “Finished” folder of the project.

 

Let’s begin.

The data in sheet “SurfaceData” of Book1 is formatted for a virtual matrix with the X values in Col(A) and the Y values in a header row entitled “Y Values”. Col(B) to Col(C124) contain the Z data for each XY pair.

First, we will create a 3D Colormap Surface plot for the data. In the worksheet, highlight all columns and from the 3D and Contour Graphs toolbar, click the 3D Colormap Surface button. The Plotting: plotvm dialog will appear. Change the settings to exactly match those in the image below including naming the virtual matrix “VMSurface”.

chd_plotvm_dialog1

 

Now click the OK button to generate the graph.

chd_graph1

 

We are interested in two types of profile lines from this data: an “X profile for a given Y value”, and a “Y profile for a given X value”. The image below illustrates how these two profiles work.

chd_profiles

 

The “X profile” data is in the worksheet columns while the “Y profile” data is in the rows. To speed up things up, profile data has already been extracted into 2 worksheets named “XProfileData” and “YProfileData”.

XProfileDataYProfileData

You can see XProfileData sheet is created by

  • Copying 1st X column in SurfaceData sheet and pasted into into Column A here.
  • Copying C57 column (with Y value=714) from SurfaceData sheet and pasted into column C . Don’t forget to set column C as Z.
  • Entering 714 in F(x) formula row of column B.

YProfileData sheet is created by

  • Highlighting Y Values row on SurfaceData sheet and copying it, and then pasting transpose to column B on YProfileData sheet.
  • Highlighting 329th row on SurfaceData sheet, copying it, and then pasting transpose to Column C on YProfileData sheet. Don’t forget to set column C as Z.
  • Deleting the 1st row since for it shows missing and 1173.65 in column B and C.
  • Entering 1173.65 in F(X) cell of Column A.

 

To plot the XProfileData into the 3D graphs,

  • make Graph window and the workbook show side by side.
  • Highlight column C on XProfileData sheet.
  • Mouse over the edge of column C border so it shows as a graph icon. Press the mouse and drag it into Graph.
  • Click OK in the popup dialog to add the plot.

XProfilePlot

It’s plotted as 3D scatter plot with drop lines. Double click on the droplines area to open Plot Details dialog.

We only want the profile shows on ZX Projection. So uncheck Original checkbox. Check ZX Projection. On Symbol tab. set Size to 0.

ZXProjection_Checkbox

 

Activatie Line tab, check Connect Symbols and customize the color and line thickness as needed. Click Apply to see the X Profile added on ZX plane.

ZXProjection_Line

 

 

Do the same for YProfileData. The only difference is check the YZ Projection checkbox on left panel of Plot Details dialog since we want the Y profile to show on YZ plane. Both profiles will be added in graph.

XYprofile_plots

 

Lastly, use Axis dialog to add special ticks labels Special Tick Labels. Let’s add one label along the X axis and one along the Y axis as per the images below.

chd_spec_tick_x

chd_spec_tick_y

 

You can also turn off the XY gridlines and contour lines on original surface plot. Here is the final graph. We’ve included a version with filled area below profiles which is done by turn on droplines. 

xyprofile_final1

xyprofile_final2

About Chris Drozdowski

Chris Drozdowski is a Product Support Engineer at OriginLab. He loves to talk to customers and educate them. He particularly relishes diagnosing and solving difficult, edge-case issues. As well, he contributes code to help solve problems or enhance user experience. In his down time at work, he likes to research and write about esoteric product features. Outside of work, he enjoys spending time with his family, having fun with C++, working on his aquarium, and exploring craft beers.

View all posts by Chris Drozdowski →

2 Comments on “Creating a 3D Surface Plot with Profile Lines”

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です