这是代码:
pic = ggplot(df_2,
aes(x = df_2$X, xend = df_2$X + df_2$dx, y = df_2$Y, yend = df_2$Y + df_2$dy, color = df_2$speedkt)) +
labs(title ="Surface Currents", x = "Longitude", y = "Latitude", colour="Speed (kts)") +
geom_segment(alpha = 0.7, arrow = arrow(length = unit(0.1,"cm"))) + coord_fixed() +
theme(panel.background = element_rect(fill = "transparent",colour = NA), plot.background = element_rect(fill = "transparent",colour = NA)) +
viridis::scale_color_viridis(option = "B", direction = -1)
Run Code Online (Sandbox Code Playgroud)
您可以看到颜色渐变遵循的值df_2$speedkt.最大值df_2$speedkt约为2.6.
因此,图例中色彩映射的最大值约为2.8.
但我希望将colormap的最大值更改为4.0.
我可以做什么?
我有以下错误:
错误11无法将"obj\x86\Debug\programname.exe"复制到"bin\Debug\programname.exe".超过重试次数10.失败.
有人能告诉我如何一步一步解决它吗?
非常感谢.
该err_flag值是TRUE,但进程仍在循环并打印“错误”。
完整代码:
while(TRUE) {
tryCatch({
some_result = some_function(some_para)
}, warning = function(war) {
print("warning")
err_flag = TRUE
}, error = function(err) {
print("error")
err_flag = TRUE
} , finally = {
})
if(err_flag) {
break
# break the while loop
}
}
Run Code Online (Sandbox Code Playgroud)