# \`InexactError\` when plotting \`DateTime\` in Plots.jl

**URL:** <https://discourse.julialang.org/t/inexacterror-when-plotting-datetime-in-plots-jl/6379>\
**Category:** Visualization\
**Created:** [October 10, 2017, 2:22pm UTC](https://discourse.julialang.org/t/inexacterror-when-plotting-datetime-in-plots-jl/6379 "2017-10-10T14:22:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [October 10, 2017, 2:22pm UTC](https://discourse.julialang.org/t/inexacterror-when-plotting-datetime-in-plots-jl/6379/1 "2017-10-10T14:22:18Z")

</div>

When attempting to plot a histogram of `DateTime` I get the following error

```julia
ERROR: LoadError: InexactError()
Stacktrace:
 [1] convert(::Type{Int64}, ::Float64) at ./float.jl:679
 [2] UTM at ./dates/types.jl:74 [inlined]
 [3] datetimeformatter(::Float64) at /home/expandingman/.julia/v0.6/Plots/src/recipes.jl:982
 [4] collect_to!(::Array{String,1}, ::Base.Generator{Array{Float64,1},Plots.#datetimeformatter}, ::Int64, ::Int64) at ./array.jl:474
 [5] _collect(::Array{Float64,1}, ::Base.Generator{Array{Float64,1},Plots.#datetimeformatter}, ::Base.EltypeUnknown, ::Base.HasShape) at ./array.jl:455
 [6] map(::Function, ::Array{Float64,1}) at ./abstractarray.jl:1865
 [7] optimal_ticks_and_labels(::Plots.Axis, ::Void) at /home/expandingman/.julia/v0.6/Plots/src/axes.jl:220
 [8] get_ticks(::Plots.Axis) at /home/expandingman/.julia/v0.6/Plots/src/axes.jl:243
 [9] _before_layout_calcs(::Plots.Plot{Plots.PyPlotBackend}) at /home/expandingman/.julia/v0.6/Plots/src/backends/pyplot.jl:1053
 [10] prepare_output(::Plots.Plot{Plots.PyPlotBackend}) at /home/expandingman/.julia/v0.6/Plots/src/plot.jl:251
 [11] show(::IOStream, ::MIME{Symbol("image/png")}, ::Plots.Plot{Plots.PyPlotBackend}) at /home/expandingman/.julia/v0.6/Plots/src/output.jl:207
 [12] png(::Plots.Plot{Plots.PyPlotBackend}, ::String) at /home/expandingman/.julia/v0.6/Plots/src/output.jl:8
 [13] savefig(::Plots.Plot{Plots.PyPlotBackend}, ::String) at /home/expandingman/.julia/v0.6/Plots/src/output.jl:123
 [14] include_from_node1(::String) at ./loading.jl:569
 [15] include(::String) at ./sysimg.jl:14
while loading /home/expandingman/AuditProject/testplots0.jl, in expression starting on line 14

```

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [October 10, 2017, 3:01pm UTC](https://discourse.julialang.org/t/inexacterror-when-plotting-datetime-in-plots-jl/6379/2 "2017-10-10T15:01:59Z")

</div>

Issue, please?

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [October 10, 2017, 5:12pm UTC](https://discourse.julialang.org/t/inexacterror-when-plotting-datetime-in-plots-jl/6379/3 "2017-10-10T17:12:32Z")

</div>

Sorry, a lot of times something comes up and it turns out whatever problem I’m having isn’t really an issue with the package I think it’s an issue with, so I’ve gotten in the habbit of asking here before posting an issue. I’ll post one now!

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [October 10, 2017, 6:04pm UTC](https://discourse.julialang.org/t/inexacterror-when-plotting-datetime-in-plots-jl/6379/4 "2017-10-10T18:04:21Z")

</div>

Sure, I didn’t mean to imply that there was anything wrong with asking here, simply that it sounded like something that would be nice to have documented in an issue.
