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

Axes origin/direction in 3d plots, advice? #408

Closed
norru opened this issue Nov 20, 2019 · 7 comments
Closed

Axes origin/direction in 3d plots, advice? #408

norru opened this issue Nov 20, 2019 · 7 comments

Comments

@norru
Copy link

norru commented Nov 20, 2019

Hi, all, looking for some advice.

In all examples I've seen, origin is top right, y grows "down" and "x" grows left, as shown here:

image

I am looking of an example that shows how to configure the x and y axes in a 3d plot so that:

  • (0,0) is at bottom left of the diagram
  • z axis grows "towards the observer" (this is already correct)
  • y axis grows "up"
  • x axis grows "right"

Thanks,
Nico

@mkborregaard
Copy link
Contributor

Oh yeah, that seems like it should be the default?

@asinghvi17
Copy link
Member

You can move the camera using rotate_cam! and translate_cam!

@norru
Copy link
Author

norru commented Nov 20, 2019

Huh? Does camera movement flip the axes?

@asinghvi17
Copy link
Member

Ah, my bad - I think I misinterpreted what you were asking for. In 3D axes, without fiddling with the code, I don't think this is possible because of some scaling issues we have with negative scale - but you could try scale!(scene, -1, -1, 1)...otherwise you could change your input data to the desired orientation, and assign ticks manually.

@norru
Copy link
Author

norru commented Nov 21, 2019

Uhm, fiddling with the data is a no go. Guess this is kind of a showstopper for now if scaling does not work.

What is the rationale behind the nonstandard axis direction?

@mkborregaard
Copy link
Contributor

@asinghvi17 is this just some kind of oversight, or am I thinking wrongly about this? I don't ever believe I've seen flipped axes by default for 3d in other plotting packages.

@ffreyer
Copy link
Collaborator

ffreyer commented Jun 4, 2021

This is very old now so I'll close this.

The coordinate system as it is (and was) is right handed as it should be. You can get to

* (0,0) is at bottom left of the diagram
* z axis grows "towards the observer" (this is already correct)
* y axis grows "up"
* x axis grows "right"

through rotations/explicitly setting update_cam!(scene, cameracontrols(scene), eyeposition, lookat, up). The axes are not made for this though.
Screenshot from 2021-06-04 22-03-26

Also scale!(scene, -1, -1, 1) doesn't really mess with your data. It sets a transformation that applies to everything in the scene, meaning every piece of data and the coordinate system. It's no different that the transformation the camera applies at that point.

@ffreyer ffreyer closed this as completed Jun 4, 2021
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

4 participants