# Linking subplot x-axes containing dates

**URL:** <https://discourse.julialang.org/t/linking-subplot-x-axes-containing-dates/61004>\
**Category:** New to Julia\
**Tags:** dates, plots\
**Created:** [May 12, 2021, 7:55am UTC](https://discourse.julialang.org/t/linking-subplot-x-axes-containing-dates/61004 "2021-05-12T07:55:57Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![goosst](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goosst/32/19090_2.png) [@goosst](https://discourse.julialang.org/u/goosst)\
**Post date:** [May 16, 2021, 7:07am UTC](https://discourse.julialang.org/t/linking-subplot-x-axes-containing-dates/61004/4 "2021-05-16T07:07:51Z")

</div>

thanks for the replies  
Not a great success so far:

> Maybe try removing the `xticks` kwarg from the individual plots and move it to the combined plot?

unfortunately that was not making a difference.

> Did you try `xlims` ? See proper syntax for dates [here](https://discourse.julialang.org/t/plots-xlims-with-x-axis-given-by-dates/47926/2).

maybe I’m not fully following the suggestion entirely, are you referring here to a syntax where automatic min\_date and max\_date are recognized by Julia or one that should be set manually?

Setting them manually, didn’t really help unfortunately:  
`plot_merged=plot(plot_water,plot_pressure,layout = (2, 1),link=:x,xlims = Dates.value.((timestamps[1],timestamps[end])))`

it provides an error, but than still plots the same as before.  
`ERROR: type ZonedDateTime has no field instant Stacktrace:`

using it in the copy-paste way throws an error and doesn’t plot  
xlims = Dates.value.((min\_date,max\_date))  
`ERROR: UndefVarError: min_date not defined`

thanks

---

_[View the full topic](https://discourse.julialang.org/t/linking-subplot-x-axes-containing-dates/61004)._
