Re: About ListPlot3D
- To: mathgroup@smc.vnet.net
- Subject: [mg11986] Re: [mg11879] About ListPlot3D
- From: Tomas Garza <tgarza@mail.internet.com.mx>
- Date: Fri, 17 Apr 1998 03:40:23 -0400
Mario Cesar wrote: > I am sorry for this question, but I do not know how to plot 3D graphics > from a list of numeric data produced by an external Fortran program. My > files have the general form: (X, Y, Z). How can I produce the heights > needed by Mathematica ? ListPlot3D plots the heights z corresponding to points of a three-dimensional array in the plane xy. I assume that your data are the list of values (X,Y,Z), where Z is the height corresponding to the pair (X,Y). You have to construct a grid in the xy plane where x varies between min X and max X, and y varies between min Y and max Y, in order to get an array of m values of x and n values of y, say. Then, for each value of x in the array, take the list of heights z corresponding to the consecutive values of y (you may have to fill in zeros, if necessary). You end up with the list h {z11, z12,..., z1n}, {z21, z22,...,z2n},...,{zm1,zm2,...,zmn}} . ListPlot3D[h] will give the 3D plot you are looking for. However, it will assign the values ,2,...m and 1,2,..n, respectively, to the consecutive points along the x and y coordinates, so that you will have to rename those points according to the actual values in your data. This should be no trouble using the TickMarks option. Good luck, Tomas Garza Mexico City