Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Period markers in iplot #516

Open
brianfeld-esd opened this issue Jul 10, 2024 · 1 comment
Open

Period markers in iplot #516

brianfeld-esd opened this issue Jul 10, 2024 · 1 comment

Comments

@brianfeld-esd
Copy link

Not sure if this is a bug (probably not), but when I call iplot to plot the estimates of an event study model, only the even periods are marked in the x-axis. Is there a straightforward way of including all period markers?

@grantmcdermott
Copy link
Contributor

Behind the scenes, iplot is simply calling R's base plotting logic. The automatic selection of axes ticks is governed by par("lab"). Per the docs:

lab: A numerical vector of the form c(x, y, len) which modifies the default way that axes are annotated.
The values of x and y give the (approximate) number of tickmarks on the x and y axes and len specifies
the label length. The default is c(5, 5, 7). len is unimplemented in R.

So one option would be to increase the x default, e.g.

op = par(lab = c(10,5,7))
iplot(...)
par(op) # reset the original params

If you would prefer a more controlled approach, then you could manually configure /override the x axis. See here for example.

Finally, you could look at at ggfixest if you'd be more comfortable configuring a ggplot2 implementation rather than base plots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants