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

Posts: 7
Registered: 4/15/13
Re: Pairing two different values on one plot
Posted: Apr 16, 2013 1:52 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"PK" wrote in message <kkio22$1bo$1@newscl01ah.mathworks.com>...
> TideMan <mulgor@gmail.com> wrote in message <d036d248-df8b-432c-a540-af02111e5621@googlegroups.com>...
> > On Tuesday, April 16, 2013 3:12:05 PM UTC+12, PK wrote:
> > > dpb <none@non.net> wrote in message <kkhh4h$h36$1@speranza.aioe.org>...
> > >

> > > > On 4/15/2013 1:44 AM, PK wrote:
> > >
> > > > > "Nasser M. Abbasi" wrote in message <kkg6na$kc5$1@speranza.aioe.org>...
> > >
> > > > >> On 4/15/2013 1:09 AM, PK wrote:
> > >
> > > > ...
> > >
> > > >
> > >
> > > > >> > Timestamp=
> > >
> > > > >> > 201203291200000
> > >
> > > > >> > 201203291215000
> > >
> > > > >> > 201203291230000
> > >
> > > > ...
> > >
> > > > >> > 201203291400000
> > >
> > > > >> > 201203291415000
> > >
> > > > >> >
> > >
> > > > ...
> > >
> > > >
> > >
> > > > >> > Now I want to plot Timestamp on x-axis and Data on y-axis so that I
> > >
> > > > >> can find
> > >
> > > > >> >the value of data at particular time.
> > >
> > > > >> >
> > >
> > > > >> > I have used
> > >
> > > > >> > plot (Data, Timestamp);
> > >
> > > > >> > but the output is awefuly different than ploting Data itself.
> > >
> > > > ...
> > >
> > > >
> > >
> > > > >> Should not this be:
> > >
> > > > >>
> > >
> > > > >> plot (Timestamp, Data );
> > >
> > > > >>
> > >
> > > > >> normally one puts time on the x-axis, as things normally are function
> > >
> > > > >> of time? When you do plot(Data), then Matlab puts i=1:N on the
> > >
> > > > >> axis by default, where N is length of Data.
> > >
> > > > ...
> > >
> > > >
> > >
> > > > > 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.
> > >
> > > >
> > >
> > > > To see at least part of the problem and why you need datenums if want
> > >
> > > > other than ordinal x axis values, try
> > >
> > > >
> > >
> > > > diff(Timestamp(1:10)/10E2)
> > >
> > > >
> > >
> > > > at the command line and observe what you get...
> > >
> > > >
> > >
> > > > --
> > >
> > > thanks for ur replies.
> > >
> > >
> > >
> > > However,use of
> > >
> > > dn=datenum(ts(:,1:12),'YYYYmmddHHMM');
> > >
> > > gives an error
> > >
> > > " ??? DATENUM failed.
> > >
> > > Failed on converting date string to date number."
> > >
> > >
> > >
> > > I thinks the format 'YYYYmmddHHMM' is not valid.
> > >
> > >
> > >
> > > if my timestamp were 2012-03-29-15-00, I could have used "YYYY-mm-dd-HH-MM".but its not the case.
> > >
> > >
> > >
> > > again my time stamp are sorted and plot(x,y,'*') would not work either.
> > >
> > > please help.

> >
> > Instead of 'YYYYmmddHHMM', try 'yyyymmddHHMM'

>
>
> yeah...nearly there, however the x-axis shows this number e.g 7.~ x 10^5 instead of date/time. and when I use data cursor tip to check the value it gives the value of that number like 7.35+005 and my data. I want to see the date/time not the number.
>
> also few of my data are with a decimal point like 65.9 and the graph only shows the rounded number like 66.




Ok

now I managed to get dates on x axis but it only shows the date not the time. and the cursot tip still shows the number 7.~+005 with my data.



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.