Wolfgang Grond
2023-Jan-09 13:58 UTC
[R] Interactive 3D Plot with non-numeric axis tick labels
Dear all, What I want to create is an interactive 3D plot from a data frame like this: #: number TLD: Countrycode Date: date String: a label Because plot3d can only deal with numbers I converted Date to Year and TLD as well as String to a numeric value like this: numTLD <- as.numeric(factor(df$TLD)) # TLD Date String Year numTLD numString 1 DE 1988-11-07 B23K 1988 3 74 2 DE 1984-09-06 B23K 1984 3 74 3 DE 1996-03-21 B23K 1996 3 74 4 DE 1996-03-21 B23K 1996 3 74 5 DE 1996-03-21 B23K 1996 3 74 6 DE 1996-03-21 B23K 1996 3 74 7 DE 1996-03-21 B23K 1996 3 74 8 DE 1996-03-21 B23K 1996 3 74 9 DE 1996-03-21 B23K 1996 3 74 To create an interactive 3D plot I use: plot3d(df$numTLD, df$Year, df$numString) The plot then shows numeric axis ticks labels, which is what I want to get in the case of Year. But for numTLD and numString I want to have - DE instead of 3 for TLD - B23K instead of 74 for String (axis ticks labeled with strings, not with numbers). I didn't succeed to figure out how this can be reached. Thanks in advance for any help. Regards