Skip to content

decimal places in geom_contour2 plot  #117

@IssamHu

Description

@IssamHu

Dear Sir,
How can I reduce the decimal places in the geom_contour2 plot
my codes:

library("ggplot2")
library("plotly")
library("reshape2")
library("gridExtra")
library("metR")
vol<-read.csv(file.choose()) ###ocean_raster_contour_2019_New
vol$Date<- as.Date(vol$Date, format = "%m/%d/%Y")
okl<- ggplot() +
geom_contour_fill(data=vol, aes(x=Date, y=Depth, z= Temperature)) +

scale_fill_distiller(palette="Spectral", name="°C") +
geom_contour2(data=vol,aes(x=Date,y=Depth,z=Salinity, color=..level..)) +

theme_bw() + geom_text_contour(data=vol,aes(x=Date,y=Depth,
z=Salinity)) +

scale_y_continuous(trans = "reverse") +

scale_x_date(date_breaks = "1 month") +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),

    axis.title.x=element_blank()) +
guides(color=guide_legend("PPT"))
okl

That what I get:

Rplot

I have rounded my data in the csv file but still can't solve the problem:
ocean_raster_contour_2019_New.txt
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions