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

Why rescale data? #1

Open
Bisaloo opened this issue Apr 3, 2018 · 6 comments
Open

Why rescale data? #1

Bisaloo opened this issue Apr 3, 2018 · 6 comments

Comments

@Bisaloo
Copy link

Bisaloo commented Apr 3, 2018

Hi,

Thank you for this package! I may be missing something obvious but why rescale data? It makes it impossible to do some semi-complex operations such as:

library(ggplot2)
library(gg3D)

data(iris)
iris2 <- iris
iris2$Petal.Width <- iris2$Petal.Width + 10

g <- ggplot(iris, aes(x=Petal.Width, y=Sepal.Width, z=Petal.Length, color=Species)) + 
  theme_void() +
  axes_3D() +
  stat_3D()

g2 <- g +
  stat_3D(aes(x=Petal.Width, y=Sepal.Width, z=Petal.Length, color=Species), iris2)

Here, we expect g and g2 to be different since g2 has an additional layer with different data but they look just the same.

@AckerDWM
Copy link
Owner

AckerDWM commented Apr 3, 2018

That's a good point. I usually only use 3D for quickly visualizations, hence scaling minimizes how much work I have to do prior to plotting.

I will probably make scaling optional in an update. For now, a workaround would be to combine iris and iris2 into a single dataframe.

@AckerDWM AckerDWM closed this as completed Apr 3, 2018
@AckerDWM AckerDWM reopened this Apr 3, 2018
@Bisaloo
Copy link
Author

Bisaloo commented Apr 3, 2018

For now, a workaround would be to combine iris and iris2 into a single dataframe.

Good point. I guess my example was not so good. I actually want to use different geom for my two datasets. This is why I am using two datasets.

@Bisaloo
Copy link
Author

Bisaloo commented Apr 5, 2018

Would you like me to submit a PR to try and fix this?

@AckerDWM
Copy link
Owner

AckerDWM commented Apr 5, 2018 via email

@Bisaloo
Copy link
Author

Bisaloo commented Apr 26, 2018

It's harder than what I anticipated (but you probably already knew that 😃).

perspbox output will depend on the limits for x, y and z. Those limits can change between the different stat_3D layers. I think we would need a way to somehow exchange information between layers so limits in perspbox can be set for all layers. I'm not sure it's possible...

What do you think? Maybe you already gave it some thought and have more ideas than me.

@AckerDWM
Copy link
Owner

AckerDWM commented Apr 26, 2018 via email

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

2 participants