Closed IssamHu closed 4 years ago
You need to round the label
aesthetic in the geom_text_contour
call. Like this:
geom_text_contour(data = vol, aes(x = Date, y = Depth, z = Salinity,
label = round(..level.., 2)))
Alternatively, (and probably better), you could force the breaks of the geom to be round numbers. I'm without a computer with R install so I can't create a reprex, but I hope the previous example is enough.
PS: I reformatted your comment so that the code is in a codeblock.
Thank you very much, it works with me
This doesn't need to be reopened, but I can add that format()
seems to work appropriately as well, but I could not get scales::label_number()
to work.
label = format(..level..,
scientific = F,
big.mark = ",")
Dear Sir, How can I reduce the decimal places in the geom_contour2 plot my codes:
That what I get:
I have rounded my data in the csv file but still can't solve the problem: ocean_raster_contour_2019_New.txt Thanks