[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
turn off the colors in a matrix plot
From: |
Kamaraju S Kusumanchi |
Subject: |
turn off the colors in a matrix plot |
Date: |
Tue, 15 Apr 2008 09:29:24 -0400 |
User-agent: |
KNode/0.10.4 |
I have a matrix, say
octave:94> f=[1 2 3 4; 0 1 2 3; -1 0 1 2]
f =
1 2 3 4
0 1 2 3
-1 0 1 2
and I would like to plot this matrix as a surface using the row index and
column index as the x, y values. That is my points in the 3-D plot would be
(1,1, 1) (1,2,2) (1,3,3) (1,4,4)
(2,1, 0) (2,2,1) (2,3,2) (2,4,3)
(3,1,-1) (3,2,0) (3,3,1) (3,4,2)
Currently I am doing this by
octave:95> NX=3; NY=4; [yy, xx] = meshgrid([1:NY],[1:NX]), f=[1 2 3 4; 0 1 2
3; -1 0 1 2], mesh(xx, yy, f), xlabel("x"), ylabel("y")
This gives me the correct plot as desired. However, the values are plotting
with color coding in them (red to blue). Is there any way to turn off the
colors? Is there any option to remove the lines and just plot the points?
Also, I would appreciate if someone could provide an elegant way to solve
the above problem of plotting the matrix. Right now, my solution looks very
round about way of doing it with all the reordering of x, y coordinates
etc., Any suggestions?
thanks
raju
--
Kamaraju S Kusumanchi
http://www.people.cornell.edu/pages/kk288/
http://malayamaarutham.blogspot.com/
- turn off the colors in a matrix plot,
Kamaraju S Kusumanchi <=