Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   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
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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

>>
> 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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.