MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: date/time ListPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21010] Re: [mg20979] date/time ListPlot
  • From: Jean-Marie Thomas <jmt at agat.net>
  • Date: Thu, 2 Dec 1999 21:41:22 -0500 (EST)
  • Organization: TeA
  • References: <199912010650.BAA07780@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Suppose your data is something like :

data={{"jan-1999", 0.147547}, {"feb-1999", 0.830731}, {"mar-1999", 
    0.316274}, {"apr-1999", 0.412676}, {"may-1999", 0.904133}, {"jun-1999", 
    0.715454}, {"jul-1999", 0.849452}, {"aug-1999", 0.229427}, {"sep-1999", 
    0.734955}, {"oct-1999", 0.474554}, {"nov-1999", 0.459248}, {"dec-1999", 
    0.275582}, {"jan-2000", 0.859864}, {"feb-2000", 0.482177}, {"mar-2000", 
    0.980089}, {"apr-2000", 0.615447}, {"may-2000", 0.863428}, {"jun-2000", 
    0.481631}, {"jul-2000", 0.98173}, {"aug-2000", 0.685089}, {"sep-2000", 
    0.975488}, {"oct-2000", 0.604934}, {"nov-2000", 0.933307}, {"dec-2000", 
    0.0411275}, {"jan-2001", 0.827941}, {"feb-2001", 0.774203}, {"mar-2001", 
    0.617033}, {"apr-2001", 0.628451}, {"may-2001", 0.923808}, {"jun-2001", 
    0.0587493}, {"jul-2001", 0.767581}, {"aug-2001", 0.399024}, {"sep-2001", 
    0.188854}, {"oct-2001", 0.584195}, {"nov-2001", 0.308333}, {"dec-2001", 
    0.123442}};


{d, n} = Transpose[data];
ListPlot[n, PlotJoined -> True, 
  Ticks -> {MapIndexed[{First[#2], #1} &, d], Automatic}]

If the ticks are too tight, take only a few :
ListPlot[n, PlotJoined -> True, 
  Ticks -> {Cases[
        MapIndexed[{First[#2], #1} &, d], _?(Mod[First[#], 6] == 0 &)], 
      Automatic}]


On Wed, 01 Dec 1999, magni wrote:
> I am badly in need to create a plot of points
> 
> in which the abscissa is a date - they span some years,
> 
> so at least I need ticks like "Jan-99" or similar.
> 
> I absolutely didn't find anything on this subject,
> 
> in the newsgroup nor on Wolfram site, nor on The Book.
> 
> The only exception is the package of Nigel King, that
> 
> I cannot find a way to let it work.
> 
> Since it seems to me a rather basic plotting usage,
> 
> is it possible there isnt anything on this subject?
> 
> Thank you in advance
> 
>     Alessandro
> 
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> \  Dr.Alessandro Magni
> /                               IEN Galileo Ferraris
> \                               c.M.d'Azeglio 42, 10125 Torino (ITALIA)
> /                               magni at ien.it
> \                               Fax (39)11-6507611
> /                               Tel (39)11-3919757
> \                               Homepage at: http://www.ien.it/~magni/home.htm
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  • Prev by Date: Re: Solving complex trigonometric equations
  • Next by Date: RE: Packed Array Angst
  • Previous by thread: date/time ListPlot
  • Next by thread: Re: date/time ListPlot