0

I am trying to plot an X discrete value and a Y continuous value.

My dataframe is as follows : Dublin_Average

Postcode is of type character ( CoDublin , D1 ....... )

Price is numeric

Here is a snippet of the data.

*row 1*
CoDublin
458379.8


*row 2*
D1
613516.4


*row 3*
D2
586021.3


I have this code for my ggplot which plots X fine but for Y it does not give me the range from lets say 100000.0 to 900000.0 .

ggplot(Dublin_Average, 
       aes(x = Postcode, y=Price)) +
  geom_col(fill = "blue", col = "red", alpha=I(.2), main = "Frequency of Post Code")

It gives me these on the Y axis instead;

1e+06

5e+05

0e+00

I know I am missing something, how can I resolve this issue on the Y-axis ?

mrwahl
  • 79
  • 1
  • 9
  • You can use `library(scales)` and change the y-axis by `scale_y_continuous(labels = comma)` – neuron Nov 21 '21 at 18:16
  • In the future, please use `dput()` on your data and share it in your question. It is especially important when you want someone to help fix your plot. – neuron Nov 21 '21 at 18:17

0 Answers0