SXS
SXS

Reputation: 303

How to make the x-axis labels appear between ticks

Consider the following toy example:

sysuse sp500, clear
keep in 1/5

graph twoway (connected close date),xlabel(14977(1)14983, labsize(vsmall) nogextend)

enter image description here

The produced graph has data points, ticks and x-axis labels on the same vertical line.

Instead, I would like the labels to appear in between the ticks. How can I do this?

Upvotes: 0

Views: 707

Answers (1)

user8682794
user8682794

Reputation:

Here is one way to do this:

sysuse sp500, clear
keep in 1/5

graph twoway (connected close date), xtick(14977(2)14983, tlength(*1.5)) ///
xlabel(14977.5(2)14983.5, labsize(small) nogextend notick) xtitle("") 

enter image description here

For full details see:

Upvotes: 2

Related Questions