String labels in the x axis


I’m trying to make a plot with a numerical series on the y axis and a string series on the x axis. The x series is a vector like this, imported which is extracted from a data frame:

88-element Vector{Any}:
 "1997 Q4"
 "1998 Q1"
 "1998 Q2"
 "1998 Q3"
 "2018 Q4"
 "2019 Q1"
 "2019 Q2"
 "2019 Q3"

The I’m using is the following:

using Plots


This produces the following plot

The issue is the following: I want the xlabels not to overlap, but I want them to go from 1997 Q4 to 2019 Q3, for example. Using the xticks attribute, this does not seem possible. I’ve tried several combinations of the xticks attribte, but the labels either end in 1998Q, or if I do 1:1:88, they just overlap and become unreadable. I also used xticks=8, but I get an error saying that I cannot convert strings to numeric variables.

What’s the correct way to do this? Thanks

Solved it:

using Plots