Show Sidebar Hide Sidebar

axis.ticks in ggplot2

How to modify axis ticks in R and ggplot2.

New to Plotly?

Plotly's R library is free and open source!
Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode.
We also have a quick-reference cheatsheet (new!) to help you get started!

Version Check

Version 4 of Plotly's R package is now available!
Check out this post for more information on breaking changes and new features available in this version.

## [1] ''

Axis Labels


df <- diamonds[sample(1:nrow(diamonds), size = 1000),]

p <- ggplot(df, aes(carat, price)) + 
  geom_point() + 
  theme(axis.ticks = element_line(size = 10))

p <- ggplotly(p)

# Create a shareable link to your chart
# Set up API credentials:
chart_link = plotly_POST(p, filename="axis-ticks/size")

Inspired by ggplot2 documentation