You should be able to do this with scale_x_discrete
.
library(ggplot2)
df <- data.frame(x = 1:5, y = sample(1:10, 5, TRUE))
qplot(factor(x),y, data = df) +
scale_x_discrete(breaks = 1:5, labels=c("foo","bar","baz","phi","fum")) +
xlab(NULL)
More Related Contents:
- Multirow axis labels with nested grouping variables
- Plot correlation matrix into a graph
- Using two scale colour gradients ggplot2 [duplicate]
- Get values and positions to label a ggplot histogram
- Adding percentage labels to a bar chart in ggplot2
- Avoid clipping of points along axis in ggplot
- How can I order the months chronologically in ggplot2 short of writing the months out?
- Issue with geom_text when using position_dodge
- Changing font size and direction of axes text in ggplot2
- How can I obtain an ‘unbalanced’ grid of ggplots?
- Remove all of x axis labels in ggplot [duplicate]
- How to put a geom_sf produced map on top of a ggmap produced raster
- Connecting across missing values with geom_line
- In ggplot2, what do the end of the boxplot lines represent?
- Add a horizontal line to plot and legend in ggplot2
- How to use subscripts in ggplot2 legends [R]
- ggplot2: How to use same colors in different plots for same factor
- Removing one tableGrob when applied to a box plot with a facet_wrap
- R: ggplot2 barplot and error bar
- ggplot2 – The unit of size
- Saving grid.arrange() plot to file
- How to plot a Stacked and grouped bar chart in ggplot?
- Apply a ggplot-function per group with dplyr and set title per group
- Overlay two ggplot2 stat_density2d plots with alpha channels
- Sort legend in ggplot2
- ggplot: Boxplot of multiple column values [duplicate]
- Set number of columns (or rows) in a facetted plot
- photo alignment with graph in r
- Color points with the color as a column in ggplot2 [duplicate]
- Add raster to ggmap base map: set alpha (transparency) and fill color to inset_raster() in ggplot2