# How to plot an annotation with datetime X

**URL:** <https://discourse.julialang.org/t/how-to-plot-an-annotation-with-datetime-x/36143>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [March 18, 2020, 2:47pm UTC](https://discourse.julialang.org/t/how-to-plot-an-annotation-with-datetime-x/36143 "2020-03-18T14:47:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronneesley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronneesley/32/11072_2.png) [@Ronneesley](https://discourse.julialang.org/u/Ronneesley)\
**Post date:** [March 18, 2020, 2:47pm UTC](https://discourse.julialang.org/t/how-to-plot-an-annotation-with-datetime-x/36143/1 "2020-03-18T14:47:42Z")

</div>

Hello,

```
 Using Plots module I have a problem positioning annotations as you can see:

```

```julia
using Plots
x = 1
plot([x], [1], legend=false)
annotate!([x], [2], Plots.text("Here", 16, :red, :center))

```

![text](https://global.discourse-cdn.com/julialang/original/3X/0/6/0659dc32b804bc24d42068e644ca18a107e9452f.png)

This works perfectly, positioning an annotation at coordinates (1, 2). But when I work with dates, see:

```julia
using Dates, Plots
x = DateTime(2020, 03, 18)
plot([x], [1], legend=false)
annotate!([x], [2], Plots.text("Here", 16, :red, :center))

```

I got:

```julia
MethodError: no method matching wctondc(::DateTime, ::Int64)
Closest candidates are:
  wctondc(!Matched::Real, ::Real) at /home/user/.julia/packages/GR/tPkHV/src/GR.jl:2579

```

---

<div class="post-metadata">

**Author:** ![shg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shg/32/207943_2.png) [@shg](https://discourse.julialang.org/u/shg)\
**Post date:** [March 20, 2020, 3:11pm UTC](https://discourse.julialang.org/t/how-to-plot-an-annotation-with-datetime-x/36143/2 "2020-03-20T15:11:51Z")

</div>

You need to convert the DateTime object to its value.

```julia
annotate!(Dates.value.([x]), [2], Plots.text("Here", 16, :red, :center))

```
