Skip to content

Commit

Permalink
update plot function.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghui5801 committed Sep 4, 2024
1 parent 0c41115 commit 863c934
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions R/plotState.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@
#' \donttest{
#' data(climate)
#' state_data <- stateSpace(climate$AAO, E = 3, tau = 2)
#' plotState(state_data,phi=20)
#' plotState(state_data,phi=20, style=2)
#' }
plotState <- function(statedata, ...){
plotState <- function(statedata, ..., style=2){
if(dim(statedata)[2] != 3){
stop("Your E is not equal to 3, please correct.")
}
else{
if(style==2){
scatter3D(statedata[,1], statedata[,2], statedata[,3], pch = 18, bty = "u", colkey = FALSE,
col.panel ="steelblue", expand =0.4,
col.grid = "darkblue")
}
else if(style==1){
scatter3D_fancy(statedata[,1], statedata[,2], statedata[,3], pch = 16,
xlab='',ylab='',zlab='',ticktype = "detailed", ...,
theta = 15, d = 2 )
}
else{
stop("The style parameter should be 1 or 2.")
}
}

## Help function
Expand Down
4 changes: 2 additions & 2 deletions man/plotState.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 863c934

Please sign in to comment.