No BSD License  

Highlights from
plot3c

4.54545

4.5 | 11 ratings Rate this file 45 Downloads (last 30 days) File Size: 2.2 KB File ID: #5735
image thumbnail

plot3c

by Ulrich Theune

 

19 Aug 2004 (Updated 31 Jan 2005)

Plots data color coded in 3D.

| Watch this File

File Information
Description

FUNCTION PLOT3C(X,Y,Z,V,'MARKER',Title') plots the values in vector v colour coded at the positions specified by the vectors x, y, and z in a 3-D axis system. A colourbar is added on the right side of the figure.

The colorbar strectches from the minimum value of v to its maximum in 9 steps (10 values).
The second last argument is optional to define the marker being used. The default is a point. To use a different marker (such as circles, ...) send its symbol to the function (which must be enclosed in '; see example).

This function is an extension of PLOTC.

Example:
The seismic P-velocity (v) depends on the three parameters porosity (por) and the bulk moduli of the saturating fluid (kf) and the elastic frame (kd). To plot the velocity data as a function of these three parameters use (assuming that all data are given in vectors):

        plot3c(por,kd,kf,v,'d','Velocity')

Acknowledgements
This submission has inspired the following:
qgriddata, Color coded 3D scatterplot
MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (13)
03 Feb 2005 jeily cervantes

very good!!

10 May 2005 Kittipat Bot

I love it, looks fantastic. However,you plot them point by point, that makes it pretty slow. If you can make it faster I believe there should be a lot more people use this function :) Thanks a lot.

24 Aug 2005 Josef Pronek

very useful - thank you!

16 Mar 2006 Tim Hattrell

Good, extreamly useful if you have unstructured x,y,z tripples but very slow if you have more than a couple of thousand data points. I've been using this for plotting CFD dumps and it works well if you use it to take a slice through the data. I've tried to speed it up by having all the points plotted at once but to no avail, somebody with more experteese needs to have a go!

18 Apr 2006 jindi li

I like your code,quite appreciate for contribute this
however,the interactive colorbar shift doesn't seem to work
I want to make some modification to your code to enable this,but with no clue
can you help me ?

19 Apr 2006 igor scardanzan

yes... but very slow indeed !!!
it uses a FOR that is known to be slow !
to be a good code it should plot all point at once with their (variable) colors

05 Jul 2006 Jon Morris

Does exactly what I wanted... had an xyz data file from a calculation, and needed to plot the intensity (z) as a function of x and y. It worked with your *.m file. You've given me faith in my calculation!

28 Jan 2007 Jason Lee

it is a nice script for researchers.

20 Jun 2008 john doe  
02 Sep 2009 Le

Great !!! That's what I've been searching for a year. Very good job, thank you!

30 Aug 2011 J G

Hi, I'm new to matlab and I'm sure this is the function I've been looking for! My data are three vectors (coordinates) x, y and z. This is probably a stupid question but how do I define v?

22 Sep 2011 mathworks2011

basic but effective.

21 May 2012 Jul Smith

GREAT, THANKS!
Another question:
If one want to plot a cross section of those points(xzy), what will be the suitable function?
Sorry for basic question but I have tried to included without good results.
Thx, J

Please login to add a comment or rating.
Updates
29 Nov 2004

Changed the code routine to print the labels (less messy now, hopefully) and added an optional title for the colorbar.

31 Jan 2005

Added optional title for the colorbar, changed the labelling of the colorbar, and added a test whether all vectores are of the same length

Tag Activity for this File
Tag Applied By Date/Time
specialized Ulrich Theune 22 Oct 2008 07:30:31
plotting Ulrich Theune 22 Oct 2008 07:30:31
3d Ulrich Theune 22 Oct 2008 07:30:31
scatter plot Ulrich Theune 22 Oct 2008 07:30:31
graphics Ulrich Theune 22 Oct 2008 07:30:31
specialized plot Ulrich Theune 22 Oct 2008 07:30:31
graph types Ulrich Theune 22 Oct 2008 07:30:31
3d Luiz 02 Dec 2009 11:34:33
plotting Luiz 02 Dec 2009 11:34:37
graph types Luiz 02 Dec 2009 11:34:42

Contact us at files@mathworks.com