# Formatting Ticks on TimeLinePlot

**URL:** <https://community.wolfram.com/t/formatting-ticks-on-timelineplot/20857>\
**Category:** Questions\
**Tags:** data-science, graphics-and-visualization\
**Created:** [October 12, 2022, 8:39pm UTC](https://community.wolfram.com/t/formatting-ticks-on-timelineplot/20857 "2022-10-12T20:39:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregorylypny](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/gregorylypny/32/13432_2.png) [@gregorylypny](https://community.wolfram.com/u/gregorylypny)\
**Post date:** [October 12, 2022, 8:39pm UTC](https://community.wolfram.com/t/formatting-ticks-on-timelineplot/20857/1 "2022-10-12T20:39:46Z")

</div>

Hi everyone,

Is there a way to force TimeLinePlot to display ticks and tick labels only for the dates of the events themselves? Here’s an example containing an interval, Feb 1973 through May 2013, and an event occurring on a specific date, Feb 7, 2011.

```
data = {
   {
    Labeled[DateInterval[{{1973, 09, 01}, {2013, 05, 31}}], 
     "Events spans an interval"],
    Labeled[{2011, 02, 07}, "Event on a specific date"]}
   };

TimelinePlot[data, PlotLayout -> "Horizontal",
 DateTicksFormat -> {"MonthNameShort", " ", "Year"},
 PlotRange -> {{1970, 01, 01}, {2022, 11, 01}},
 ImageSize -> {Automatic, 300}]

```

When I run this, I get a timeline whose ticks marks are spaced two years apart (see attached file) and labelled as such, but what I want to show is a tick mark and label only for the three dates in my data. Is there a way to do that using the Ticks option?

Greg

[Timeline.pdf](https://community.wolfram.com/uploads/short-url/fzSyrTJZEJYYRjPa7OOZqy6Kvqh.pdf) (52.9 KB)

---

<div class="post-metadata">

**Author:** ![gregorylypny](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/gregorylypny/32/13432_2.png) [@gregorylypny](https://community.wolfram.com/u/gregorylypny)\
**Post date:** [October 12, 2022, 8:44pm UTC](https://community.wolfram.com/t/formatting-ticks-on-timelineplot/20857/2 "2022-10-12T20:44:04Z")

</div>

Just figured it out.

---

<div class="post-metadata">

**Author:** ![josklaps1](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/josklaps1/32/22044_2.png) [@josklaps1](https://community.wolfram.com/u/josklaps1)\
**Post date:** [October 23, 2022, 8:14pm UTC](https://community.wolfram.com/t/formatting-ticks-on-timelineplot/20857/3 "2022-10-23T20:14:01Z")

</div>

Hi Greg,

I’m interested. can you let me know how you solved it?

Thanks in advance! … Jos

---

<div class="post-metadata">

**Author:** ![gregorylypny](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/gregorylypny/32/13432_2.png) [@gregorylypny](https://community.wolfram.com/u/gregorylypny)\
**Post date:** [November 4, 2022, 9:04pm UTC](https://community.wolfram.com/t/formatting-ticks-on-timelineplot/20857/4 "2022-11-04T21:04:21Z")

</div>

Hi Jos,

Sorry for late reply. Have a look at this.

```
timelineData = <|
   "Rock Around the Clock" -> "1954-05-20",
   "All Along the Watchtower" -> "1967-12-07",
   "Sultans of Swing" -> "1978-05-19"
   |>;

TimelinePlot[timelineData,
 AspectRatio -> 1/8,
 Ticks -> {Values[timelineData], 
   Automatic},(*restrict the ticks to just the dates*)
 
 DateTicksFormat -> {"DayShort", " ", "MonthNameShort", " ", 
   "Year"},(*format the dates*)
 Spacings -> {1, 52, 34},
 BaseStyle -> {FontFamily -> "Futura", FontColor -> Black, 
   FontSize -> 11}, 
 LabelStyle -> {FontFamily -> "Futura", FontColor -> Black, 
   FontSize -> 11}, 
 PlotLabel -> 
  Style["RECORD RELEASE", FontFamily -> "Futura", FontSize -> 14, 
   FontColor -> Black], ImageSize -> 860]

```

---

<div class="post-metadata">

**Author:** ![josklaps1](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/josklaps1/32/22044_2.png) [@josklaps1](https://community.wolfram.com/u/josklaps1)\
**Post date:** [November 5, 2022, 10:30am UTC](https://community.wolfram.com/t/formatting-ticks-on-timelineplot/20857/5 "2022-11-05T10:30:26Z")

</div>

Hi Gregory,

Thanks for sharing your solution. It works perfectly!

Best Regards,…Jos
