0

I have a question controlling the axes in R.

I have a set of number (Like below) and I would like to empathise a specific range, but the rest of the data points are still in the figure.

For example, I want to empathise the number higher than x = 40, y = 40, located at the top right and accounted for 70% of the figure, and sizing the rest of the numbers in the rest of the other areas (30%). Therefore, how can I control the number range (40-50 = 70% of total area, 0 - 40 = 30% of the total area)in the axes?

# Create dummy dataset
df.test_data <- data.frame(x_var = 1:50 + rnorm(50,sd=15),
                           y_var = 1:50 + rnorm(50,sd=2))
# Plot data using ggplot2
ggplot(data=df.test_data, aes(x=x_var, y=y_var)) +
  geom_point()
Payton
  • 1
  • 1

1 Answers1

0

I hope it will help You in some way:

df.test_data <- data.frame(x_var = 1:50 + rnorm(50,sd=15),
                       y_var = 1:50 + rnorm(50,sd=2))

ggplot(data=df.test_data, aes(x=x_var, y=y_var)) +
  geom_point() + 
  scale_y_continuous(breaks=seq(40,50,1), limits = c(40, 50)) +
  scale_x_continuous(breaks=seq(40,80,1), limits = c(40, 50))
Sin
  • 135
  • 1
  • 9
  • Thanks, but I would like to keep all the data points but have a bigger portion of one specific range. @Sin – Payton Jan 29 '17 at 13:16