3D Plot with Date Axis?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

3D Plot with Date Axis?

Alex Restrepo
Hello,

I would like to format the X axis of the plot created via the scatterplot3d function or any other function which will work.

Here is an example of what I am trying to do:

library("scatterplot3d")

mydf=data.frame(rate=c(1,1,4,4), age=c(2,2,5,5), market_date=c('2017-01-01', '2017-02-02', '2017-03-03', '2017-04-04'))

scatterplot3d(mydf$market_date, mydf$rate, mydf$age, xaxt="n")

axis.Date(1, mydf$market_date, format="%Y-%m-%d")

I tried to hide the x axis, but it looks like xaxt is not working for the scatterplot3d function.

Using the above example, could someone please provide me with some guidance and help?

Many Thanks,

Alex


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: 3D Plot with Date Axis?

David Winsemius

> On Oct 27, 2017, at 12:22 PM, Alex Restrepo <[hidden email]> wrote:
>
> Hello,
>
> I would like to format the X axis of the plot created via the scatterplot3d function or any other function which will work.
>
> Here is an example of what I am trying to do:
>
> library("scatterplot3d")
>
> mydf=data.frame(rate=c(1,1,4,4), age=c(2,2,5,5), market_date=c('2017-01-01', '2017-02-02', '2017-03-03', '2017-04-04'))
>
> scatterplot3d(mydf$market_date, mydf$rate, mydf$age, xaxt="n")
>
> axis.Date(1, mydf$market_date, format="%Y-%m-%d")
>
> I tried to hide the x axis, but it looks like xaxt is not working for the scatterplot3d function.

Please read the "?scatterplot3d page more carefully. I think you should be looking for the x.ticklabs parameter.

--
David.

>
> Using the above example, could someone please provide me with some guidance and help?
>
> Many Thanks,
>
> Alex
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.