-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRiverside_Classification.R
More file actions
46 lines (38 loc) · 2.1 KB
/
Riverside_Classification.R
File metadata and controls
46 lines (38 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
setwd("/Users/sapu_a/Desktop/Research/Paper (Bengal Basin)/Dhaka Hydro/")
library(ggplot2)
#Reading excel file
df<-read.csv("Hat_Hydro.csv")
# Create labels for x-axis based on specified ranges
df$xlabels <- cut(df$EC..µs.cm., breaks = c(0, 250, 750, 2250, max(df$EC..µs.cm.)),
labels = c("C1", "C2", "C3", "C4"))
# Create labels for y-axis based on specified ranges
df$ylabels <- cut(df$SAR, breaks = c(0, 10, 18, 26, max(df$SAR)),
labels = c("S1", "S2", "S3", "S4"))
#Sampling no.
df$Sample<-1:15
##Riverside Classificaiton
ggplot(df, aes(x = df$EC..µs.cm., y = df$SAR))+
#for color
#ggplot(df, aes(x = df$EC..µs.cm., y = df$SAR, color = factor(Sample))) +
geom_point(size = 2) +
#geom_text(aes(label = df$X), nudge_x = 0.01, nudge_y = 0.01) +
labs(x = "EC (µs/cm)", y = "SAR") +
scale_x_continuous(limits = c(0, 15000)) +
scale_y_continuous(limits = c(0, max(df$SAR))) +
scale_x_log10(breaks = c(250, 750, 2250,15000), limits = c(100, 15000))+
geom_vline(xintercept = c(250, 750, 2250), color = "black", linetype = "solid", size = 1)+
geom_segment(aes(x = 0, y = 10, xend = Inf, yend = 2.25), color = "black",
linetype = "dashed",size=0.5) +
geom_segment(aes(x = 0, y = 18, xend = Inf, yend = 6.25), color = "black",
linetype = "dashed",size=0.5) +
geom_segment(aes(x = 0, y = 26, xend = Inf, yend = 10.25), color = "black",
linetype = "dashed",size=0.5) +
geom_text(aes(x = df$EC..µs.cm., y = df$SAR, label = df$Sample), size = 3, vjust = 1.5, hjust = 0.5) +
#scale_color_manual(values = c("#CC79A7", "#D55E00", "#0072B2", "#E69F00", "#56B4E9", "#009E73",
#"#F0E442", "#0072B2", "#000000", "#999999", "#A65628", "#CC79A7",
#"#E41A1C", "#F0E442", "#009E73")) +
#scale_color_manual(values = c("#CC79A7", "#D55E00", "#0072B2", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#000000", "#999999", "#A65628", "#CC79A7", "#E41A1C", "#F0E442", "#009E73")) +
coord_cartesian(ylim = c(0, max(df$SAR)))+
theme_bw() +
theme(panel.grid = element_blank(),
panel.background = element_rect(fill = "white"))