Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Pairing two different values on one plot
Replies: 19   Last Post: Apr 18, 2013 2:44 AM

 Messages: [ Previous | Next ]
 Lothar Schmidt Posts: 207 Registered: 12/7/04
Re: Pairing two different values on one plot
Posted: Apr 15, 2013 3:40 AM

Am 15.04.2013 08:44, schrieb PK:
>> >
>> > I have used
>> > plot (Data, Timestamp);
>> > but the output is awefuly different than ploting Data itself.
>> >

>>
> hi
> as plot(A,B); plots A on y-axis and B on x-axis, plot (Timestamp, Data )
> does not fix the issue. only swaps the axis.

plot(x,y)... this leads usually to strange looking graphs if
a) x is not sorted
b) same x-values for multiple y-values
c) combination of a and b

one thing you could do is:
plot(x,y,'*')

this just sets markers instead of potentially confusing lines.

or

[x_sorted,x_idx]=sort(x);
plot(x_sorted,y(x_idx))

this leads to ascending x-values and thus potentially less confusing
lines (in case of a).

As your plot command uses arguments in different order (y,x) you work
possibly not with the matlab default plot command and thus nobody can
solve this part of your problem.

Lothar

Date Subject Author
4/15/13 PK
4/15/13 Nasser Abbasi
4/15/13 PK
4/15/13 Nasser Abbasi
4/15/13 Lothar Schmidt
4/15/13 dpb
4/15/13 PK
4/16/13 Derek Goring
4/16/13 PK
4/16/13 PK
4/16/13 dpb
4/16/13 Steven Lord
4/16/13 dpb
4/16/13 PK
4/16/13 dpb
4/17/13 PK
4/17/13 dpb
4/18/13 PK
4/15/13 dpb
4/15/13 dpb