Prev: tree handle class
Next: Plotting multiple line in a GUI
From: Walter Roberson on 7 Jun 2010 13:25 Chris wrote: > This seems to be what I'm going for! However I believe I am setting up > the Z array wrong, I am getting an error "Z must be a matrix, not a > scalar or vector" In that case you should use scatter(X,Y,Z) Z would then be interpreted as the _color_ parameter rather than as a euclidean coordinate.
From: Chris on 7 Jun 2010 13:34 "someone" <someone(a)somewhere.net> wrote in message <huja06$5h1$1(a)fred.mathworks.com>... > "Chris " <chris.veinot(a)hotmail.com> wrote in message <huj7ip$mmd$1(a)fred.mathworks.com>... > > This seems to be what I'm going for! However I believe I am setting up the Z array wrong, I am getting an error "Z must be a matrix, not a scalar or vector" > > OK, so how did you "set it up"? > What command(s) did you use? > > > > > "Frédéric Bergeron" <frederic.bergeron(a)logiag.com> wrote in message <huj4l2$2rd$1(a)fred.mathworks.com>... > > > "Chris " <chris.veinot(a)hotmail.com> wrote in message <huj3t5$bt5$1(a)fred.mathworks.com>... > > > > I have a dataset of 123 points, it is composed of Latitude, Longitude and mean sediment diameter. What I am trying to do is to create a 2-D plot of this data using a color gradient to represent the mean sediment diameter. What would be the best way to go about doing this? > > > > > > > > Thanks > > > > > > I would try SURF(X,Y,Z,C) with an array of Z of 123 zeros. The array C is for the color gradient. See help surf for more details. > > > Surf is originally made for 3D graphs, but I don't know of a similar 2D function, so by defining the array Z as an array of zeros it would probably works. My data is all coming from an excel sheet, so I made a column of 123 rows all with zeros.
From: Chris on 8 Jun 2010 07:49 "Chris " <chris.veinot(a)hotmail.com> wrote in message <hujaid$e3t$1(a)fred.mathworks.com>... > "someone" <someone(a)somewhere.net> wrote in message <huja06$5h1$1(a)fred.mathworks.com>... > > "Chris " <chris.veinot(a)hotmail.com> wrote in message <huj7ip$mmd$1(a)fred.mathworks.com>... > > > This seems to be what I'm going for! However I believe I am setting up the Z array wrong, I am getting an error "Z must be a matrix, not a scalar or vector" > > > > OK, so how did you "set it up"? > > What command(s) did you use? > > > > > > > > "Frédéric Bergeron" <frederic.bergeron(a)logiag.com> wrote in message <huj4l2$2rd$1(a)fred.mathworks.com>... > > > > "Chris " <chris.veinot(a)hotmail.com> wrote in message <huj3t5$bt5$1(a)fred.mathworks.com>... > > > > > I have a dataset of 123 points, it is composed of Latitude, Longitude and mean sediment diameter. What I am trying to do is to create a 2-D plot of this data using a color gradient to represent the mean sediment diameter. What would be the best way to go about doing this? > > > > > > > > > > Thanks > > > > > > > > I would try SURF(X,Y,Z,C) with an array of Z of 123 zeros. The array C is for the color gradient. See help surf for more details. > > > > Surf is originally made for 3D graphs, but I don't know of a similar 2D function, so by defining the array Z as an array of zeros it would probably works. > > I still havn't figured this out, help is much appreciated. Thanks > My data is all coming from an excel sheet, so I made a column of 123 rows all with zeros.
From: John D'Errico on 8 Jun 2010 08:16 "Chris " <chris.veinot(a)hotmail.com> wrote in message <huj3t5$bt5$1(a)fred.mathworks.com>... > I have a dataset of 123 points, it is composed of Latitude, Longitude and mean sediment diameter. What I am trying to do is to create a 2-D plot of this data using a color gradient to represent the mean sediment diameter. What would be the best way to go about doing this? > > Thanks I'm surprised nobody has suggested anything useful so far. This is a scattered data interpolation problem. You can use meshgrid and then griddata to interpolate a surface, or my own gridfit to do that more easily. Find gridfit on the file exchange. http://www.mathworks.com/matlabcentral/fileexchange/8998 HTH, John
From: Chris on 8 Jun 2010 13:35
"John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <hulca4$3oe$1(a)fred.mathworks.com>... > "Chris " <chris.veinot(a)hotmail.com> wrote in message <huj3t5$bt5$1(a)fred.mathworks.com>... > > I have a dataset of 123 points, it is composed of Latitude, Longitude and mean sediment diameter. What I am trying to do is to create a 2-D plot of this data using a color gradient to represent the mean sediment diameter. What would be the best way to go about doing this? > > > > Thanks > > I'm surprised nobody has suggested anything useful so far. > > This is a scattered data interpolation problem. You can > use meshgrid and then griddata to interpolate a surface, > or my own gridfit to do that more easily. > > Find gridfit on the file exchange. > > http://www.mathworks.com/matlabcentral/fileexchange/8998 > > HTH, > John Thank you that worked perfectly! |