Scatterplot3d :: Rotating x tick labels by x degrees

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

Scatterplot3d :: Rotating x tick labels by x degrees

Alex Restrepo
Hi,

I would like to rotate the x axis tick labels by 45 degrees.   Using the code below, could someone please provide an example?   Many Thanks In Advance, Alex

library("scatterplot3d")
mydf=data.frame(rate=seq(158, 314)
                ,age=seq(1, 157)
                ,market_date=seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by="7 days"))

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

scatterplot3d(mydf$market_date
              ,mydf$rate
              ,mydf$age
              ,x.ticklabs = seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by="330 days"))


        [[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: Scatterplot3d :: Rotating x tick labels by x degrees

Olivier Crouzet-2
Hi Alex,

this should be related to the "las" argument of "par()" but
actually it does not seem to be parametered in scatterplot3d.
Searching the net for "scatterplot3d las" provides a link to:

https://stackoverflow.com/questions/25458652/specifying-the-orientation-of-the-axes-labels-in-scatterplot3d

You may try the solution that is provided in this link or consider using
alternate packages (like rgl or the plotly packages which one may be
more powerfull as far as I can judge). However I can't help more. It
seems ggplot does not produce 3d plots (but it looks like it can
interact with plotly when using 3d plots).

Olivier.

On Mon, 30 Oct 2017
23:56:02 +0000 Alex Restrepo <[hidden email]> wrote:

> Hi,
>
> I would like to rotate the x axis tick labels by 45 degrees.   Using
> the code below, could someone please provide an example?   Many
> Thanks In Advance, Alex
>
> library("scatterplot3d")
> mydf=data.frame(rate=seq(158, 314)
>                 ,age=seq(1, 157)
>                 ,market_date=seq(as.Date("2000/1/1"), as.Date
> ("2003/1/1"), by="7 days"))
>
> mydf$market_date=as.Date(mydf$market_date, format="%Y-%m-%d")
>
> scatterplot3d(mydf$market_date
>               ,mydf$rate
>               ,mydf$age
>               ,x.ticklabs = seq(as.Date("2000/1/1"), as.Date
> ("2003/1/1"), by="330 days"))
>
>
> [[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.


--
  Olivier Crouzet, PhD
  /Assistant Professor/
  @LLING - Laboratoire de Linguistique de Nantes
    UMR6310 CNRS / Université de Nantes
  /Guest Researcher/
  @UMCG (University Medical Center Groningen)
    ENT department
    Rijksuniversiteit Groningen

______________________________________________
[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: Scatterplot3d :: Rotating x tick labels by x degrees

Uwe Ligges-3
In reply to this post by Alex Restrepo


On 31.10.2017 00:56, Alex Restrepo wrote:
> Hi,
>
> I would like to rotate the x axis tick labels by 45 degrees.   Using the code below, could someone please provide an example?   Many Thanks In Advance, Alex

45 degree rotation is not supported in base R graphics and scatterplot3d
uses that.

You can use par(las=2)
before your code and get them rrotated by 90 degrees, or you can add
them individually by

s3d <- scatterplot3d(....

Afterwards you could try along trhese lines:

par(xpd=TRUE)
text(s3d$xyz.convert(desired positions of labels in 3D coordinate
system), labels, angle=45)

(untested)

Best,
Uwe Ligges





>
> library("scatterplot3d")
> mydf=data.frame(rate=seq(158, 314)
>                  ,age=seq(1, 157)
>                  ,market_date=seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by="7 days"))
>
> mydf$market_date=as.Date(mydf$market_date, format="%Y-%m-%d")
>
> scatterplot3d(mydf$market_date
>                ,mydf$rate
>                ,mydf$age
>                ,x.ticklabs = seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by="330 days"))
>
>
> [[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.
Reply | Threaded
Open this post in threaded view
|

Re: Scatterplot3d :: Rotating x tick labels by x degrees

David Winsemius
In reply to this post by Olivier Crouzet-2

> On Oct 31, 2017, at 8:55 AM, Olivier Crouzet <[hidden email]> wrote:
>
> Hi Alex,
>
> this should be related to the "las" argument of "par()" but
> actually it does not seem to be parametered in scatterplot3d.
> Searching the net for "scatterplot3d las" provides a link to:
>
> https://stackoverflow.com/questions/25458652/specifying-the-orientation-of-the-axes-labels-in-scatterplot3d
>
> You may try the solution that is provided in this link or consider using
> alternate packages (like rgl or the plotly packages which one may be
> more powerfull as far as I can judge). However I can't help more. It
> seems ggplot does not produce 3d plots (but it looks like it can
> interact with plotly when using 3d plots).

Olivier;

The cited SO solutions (mine being the first one)  were addressing the request for rotated "axis"-labels rather than rotated "axtick"-labels, although the general strategy of looking at the code and using the `text`-function with xpd=TRUE (rather than the `mtext`-function where needed in the definitions of mytext and mytext2) should apply.

Alex;

I'd encourage you to demonstrate more initiative rather than expecting us to be on-call code servants.  I've decided to limit my gratis coding time to 15 minutes daily. I think this might take me an hour or more. I'm still available for on-list code review on this effort.

As a start, I'd suggest downloading the scatterplot3d package code and then open up scatterplot3d.R. Find the comment

## label tick marks

... and perhaps decide whether you need to use `text` rather than `mtext`. (`text` can rotate by any amount,
but may need "xpd" to be set TRUE. `mtext` is limited to 90 degree increments.) I've used up my time, so the next move is yours.
--
David.


>
> Olivier.
>
> On Mon, 30 Oct 2017
> 23:56:02 +0000 Alex Restrepo <[hidden email]> wrote:
>
>> Hi,
>>
>> I would like to rotate the x axis tick labels by 45 degrees.   Using
>> the code below, could someone please provide an example?   Many
>> Thanks In Advance, Alex
>>
>> library("scatterplot3d")
>> mydf=data.frame(rate=seq(158, 314)
>>                ,age=seq(1, 157)
>>                ,market_date=seq(as.Date("2000/1/1"), as.Date
>> ("2003/1/1"), by="7 days"))
>>
>> mydf$market_date=as.Date(mydf$market_date, format="%Y-%m-%d")
>>
>> scatterplot3d(mydf$market_date
>>              ,mydf$rate
>>              ,mydf$age
>>              ,x.ticklabs = seq(as.Date("2000/1/1"), as.Date
>> ("2003/1/1"), by="330 days"))
>>
>>
>> [[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.
>
>
> --
>  Olivier Crouzet, PhD
>  /Assistant Professor/
>  @LLING - Laboratoire de Linguistique de Nantes
>    UMR6310 CNRS / Université de Nantes
>  /Guest Researcher/
>  @UMCG (University Medical Center Groningen)
>    ENT department
>    Rijksuniversiteit Groningen
>
> ______________________________________________
> [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.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[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: Scatterplot3d :: Rotating x tick labels by x degrees

Jim Lemon-4
In reply to this post by Uwe Ligges-3
Well, scatterplot3d might not allow it, but have a look at the second
example for staxlab in the plotrix package.

Jim

On Wed, Nov 1, 2017 at 7:30 AM, Uwe Ligges
<[hidden email]> wrote:
>
>
> On 31.10.2017 00:56, Alex Restrepo wrote:
> ...
> 45 degree rotation is not supported in base R graphics and scatterplot3d
> uses that.
>

______________________________________________
[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: Scatterplot3d :: Rotating x tick labels by x degrees

Alex Restrepo
In reply to this post by David Winsemius
Hello,

David, don’t worry about answering this question or any of my inquiries in the future.  Not looking for code servants. Definitely not an expert at using the scatter plot 3D  library.  That being said, I plan on researching rgl as was recommended so kindly on a previous response to my question.

Regards, Alex

On Oct 31, 2017, at 4:13 PM, David Winsemius <[hidden email]<mailto:[hidden email]>> wrote:


On Oct 31, 2017, at 8:55 AM, Olivier Crouzet <[hidden email]<mailto:[hidden email]>> wrote:

Hi Alex,

this should be related to the "las" argument of "par()" but
actually it does not seem to be parametered in scatterplot3d.
Searching the net for "scatterplot3d las" provides a link to:

https://stackoverflow.com/questions/25458652/specifying-the-orientation-of-the-axes-labels-in-scatterplot3d

You may try the solution that is provided in this link or consider using
alternate packages (like rgl or the plotly packages which one may be
more powerfull as far as I can judge). However I can't help more. It
seems ggplot does not produce 3d plots (but it looks like it can
interact with plotly when using 3d plots).

Olivier;

The cited SO solutions (mine being the first one)  were addressing the request for rotated "axis"-labels rather than rotated "axtick"-labels, although the general strategy of looking at the code and using the `text`-function with xpd=TRUE (rather than the `mtext`-function where needed in the definitions of mytext and mytext2) should apply.

Alex;

I'd encourage you to demonstrate more initiative rather than expecting us to be on-call code servants.  I've decided to limit my gratis coding time to 15 minutes daily. I think this might take me an hour or more. I'm still available for on-list code review on this effort.

As a start, I'd suggest downloading the scatterplot3d package code and then open up scatterplot3d.R. Find the comment

## label tick marks

... and perhaps decide whether you need to use `text` rather than `mtext`. (`text` can rotate by any amount,
but may need "xpd" to be set TRUE. `mtext` is limited to 90 degree increments.) I've used up my time, so the next move is yours.
--
David.



Olivier.

On Mon, 30 Oct 2017
23:56:02 +0000 Alex Restrepo <[hidden email]<mailto:[hidden email]>> wrote:

Hi,

I would like to rotate the x axis tick labels by 45 degrees.   Using
the code below, could someone please provide an example?   Many
Thanks In Advance, Alex

library("scatterplot3d")
mydf=data.frame(rate=seq(158, 314)
              ,age=seq(1, 157)
              ,market_date=seq(as.Date("2000/1/1"), as.Date
("2003/1/1"), by="7 days"))

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

scatterplot3d(mydf$market_date
            ,mydf$rate
            ,mydf$age
            ,x.ticklabs = seq(as.Date("2000/1/1"), as.Date
("2003/1/1"), by="330 days"))


   [[alternative HTML version deleted]]

______________________________________________
[hidden email]<mailto:[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.


--
Olivier Crouzet, PhD
/Assistant Professor/
@LLING - Laboratoire de Linguistique de Nantes
  UMR6310 CNRS / Université de Nantes
/Guest Researcher/
@UMCG (University Medical Center Groningen)
  ENT department
  Rijksuniversiteit Groningen

______________________________________________
[hidden email]<mailto:[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.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email]<mailto:[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.

        [[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: Scatterplot3d :: Rotating x tick labels by x degrees

Alex Restrepo
In reply to this post by Jim Lemon-4
Thanks Jim, I will research.  I appreciate the response.

On Oct 31, 2017, at 9:33 PM, Jim Lemon <[hidden email]<mailto:[hidden email]>> wrote:

Well, scatterplot3d might not allow it, but have a look at the second
example for staxlab in the plotrix package.

Jim

On Wed, Nov 1, 2017 at 7:30 AM, Uwe Ligges
<[hidden email]<mailto:[hidden email]>> wrote:


On 31.10.2017 00:56, Alex Restrepo wrote:
...
45 degree rotation is not supported in base R graphics and scatterplot3d
uses that.


        [[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.