This is my data
mydata = {{0.55, 31.7, 26.360, "acid 0-TOLUIC"}, {0.3925, 31.503,
31.4861, "acid 2- methyloctanoic"}, {0.711, 11.299, 17.4735,
"acid 6-hydroxyhexanoic"}, {0.495, 27.57, 30.437,
"acid acetic"}, {0.506, 49.6, 35.486,
"acid acetoxyacetic"}, {0.753, 17.37, 13.3028,
"acid acetylsalicylic"}, {0.873, 5.576, 5.325,
"acid azelaic"}, {0.652, 17.968, 17.040,
"acid cyclopentylacetic"}, {0.471, 33.9659, 33.384,
"acid glutaric"}, {0.753, 26.96, 20.881,
"acid isophtalic"}, {0.673, 22.433, 26.411,
"acid maleic"}, {0.627, 25.7, 21.504, "acid m-toluic"}, {0.749,
12.187, 10.113, "acid neohexanoic"}, {0.5512, 20.3642, 22.555,
"acid n-nonanoic"}, {0.802, 7.629, 8.243,
"acid n-undecanoic"}, {0.830, 9.426, 10.141,
"acid phtalic"}, {0.864, 8.713, 7.9158, "acid salycilic"}};
I want to plot the data with different colors depending to name of the data. So, if the data are (e.g. "acid n-undecanoic" or "acid salycilic") in a particular way I want them in red otherwise in green. Following my not working code.
ListPlot[{mydata[[All, 2]], mydata[[All, 1]]}\[Transpose],
PlotStyle -> {If[
mydata[[All, -1]] == "acid n-undecanoic" ||
mydata[[All, -1]] == "acid salycilic", Red, Green]}]