Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news2!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe03.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Organization: Canada Eat The Cookie Foundation
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: Plotting 3D graph in a plane
References: <10981321.1223775974068.JavaMail.jakarta@nitrogen.mathforum.org>
In-Reply-To: <10981321.1223775974068.JavaMail.jakarta@nitrogen.mathforum.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 23
Message-ID: <knfIk.4325$CM1.825@newsfe03.iad>
NNTP-Posting-Host: 24.79.146.116
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe03.iad 1223787088 24.79.146.116 (Sun, 12 Oct 2008 04:51:28 UTC)
NNTP-Posting-Date: Sun, 12 Oct 2008 04:51:28 UTC
Date: Sat, 11 Oct 2008 23:51:36 -0500
Xref: news.mathworks.com comp.soft-sys.matlab:494742


kagohaik wrote:
> I am new in matlab and I would like to plot a 3D graph in a 2D graph.
> The x and y axis are representing the independent variables. There are only two values 
> for the dependent variables, which are 2,3, in which I would like to represent it with 
> different symbols in the 2D graph. How am I going about doing this?

I suggest using scatter(). It would be easier to use different colors rather than different
symbols, but here is how you can do it using different symbols:

xt = x;
xt(z~=2) = nan;
scatter(xt,y,SymbolSize,'o');   %'o' marker for first value
xt = x;
xt(z~=3) = nan;
scatter(xt,y,SymbolSize,'+')    %'+' marker for second value

If you add the color information you can obviously generalize this to as many
distinctive colour / marker combinations as you can come up with (though
if you were to get into that, you'd -probably- be wanting to use value ranges
rather than exact comparisons)

xt = x;
xt(abs(z-7.2) > 4*eps(7.2)) = nan;   %preserve only values really close to 7.2