Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting two different matrix rasterimage and contour #95

Open
IssamHu opened this issue Apr 5, 2020 · 0 comments
Open

Plotting two different matrix rasterimage and contour #95

IssamHu opened this issue Apr 5, 2020 · 0 comments

Comments

@IssamHu
Copy link

IssamHu commented Apr 5, 2020

Prof.
I'm trying to plot two different Argo matrix (Temperature and Salinity) in a single plot like this plot:
The temperature is the rasterimage and the salinity is the contour lines.
tempsalinity

The two matrix were not identical either in date and/or depth, so I gave 0 to the empty cell:

Argo_Arabian_Sea_2018_Salin_Depth.txt
Argo_Arabian_Sea_2018_Temp_Depth.txt

Using these codes I get these results:

Temp<-read.csv(file.choose())
Sali<-read.csv(file.choose())
library("plot3D")
par(mfrow = c(1, 1))
image2D(z = Temp, shade = 0.2, rasterImage = TRUE)
Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric variables
contour2D(z = Sali, col = "white", labcex = 0.8,

  •       lwd = 3, alpha = 0.5, add = TRUE)
    

Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric variables

Please advice me to the correct codes to get the plot.

Thanks
Issam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant