Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15348

Re: Rotate Dateticks in DateListPlot

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Rotate Dateticks in DateListPlot
Date 2013-08-23 09:27 +0000
Message-ID <kv79un$bu1$1@smc.vnet.net> (permalink)
References <20130822045203.56DDD6A19@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


data = {{{2006, 10, 1}, 10}, {{2006, 10, 15}, 12},
   {{2006, 10, 30}, 15}, {{2006, 11, 20}, 20}};


dlp = DateListPlot[data,
  Epilog -> (Text[
       ToString[{#[[1, 3]], #[[2]]}],
       #, 5/4*Sign[DateDifference[
           {2006, 11, 1}, #[[1]]]*
          {1, 1}]] & /@ data)]


Rotate all strings:


Show[dlp /. str_String :>
   Rotate[str, 90 Degree]]


Rotate just Frame date labels:


Show[dlp /. {v_, str_String} :>
   {v, Rotate[str, 90 Degree]}]



Bob Hanlon




On Thu, Aug 22, 2013 at 12:52 AM, Gregory Lypny
<gregory.lypny@videotron.ca>wrote:

> Hi everyone,
>
> Bob Hanlon posted a neat way of rotating the frame ticks (date markers) on
> a date list plot.
>
> data = {{{2006, 10, 1}, 10}, {{2006, 10, 15}, 12}, {{2006, 10, 30},
>     15}, {{2006, 11, 20}, 20}};
>
> Show[DateListPlot[data] /.
>   str_String :> Rotate[str, 90 Degree]]
>
> It works like a charm as long as their are no other string annotations in
> the plot; otherwise, those other annotations will be rotated too.  Is there
> a way to rotate only the frame ticks?
>
> Regards,
>
> Gregory
>
>
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Rotate Dateticks in DateListPlot Bob Hanlon <hanlonr357@gmail.com> - 2013-08-23 09:27 +0000

csiph-web