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

3-D perspective views in subplots #6517

Open
PaulWessel opened this issue Apr 4, 2022 · 2 comments
Open

3-D perspective views in subplots #6517

PaulWessel opened this issue Apr 4, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@PaulWessel
Copy link
Member

Subplot expects information about panel size via -S. however, for 3-D perspective views it appears as these have little effect. This is related to the earlier fix #6516 for placement of colorbars. For instance, here is a 2x1 plot:

view

It is similar: subplot uses the -R -J of the equivalent 2-D plot (-R-32/52/-32/32 -Jx0.2c) and that gives a 16.8 x 16.8 cm square plot. That is why there is so much white space. To confirm I can run the same script with -p180/90 and get

view3

So here we see that spacing is honored but it is always calculated as if a 2-D flat plot. I think what we want is the following:

When a perspective plot is desired for a panel, the fitting of the plot inside the given space needs a special check: We must compute the 3-D box and its 2-D coordinates and use that bounding box as the equivalent 2-D plot region. We can now shrink that to fit the panel. Then, that shrink factor can be applied to the 3-D projection as well.

In my case, I would have to select a -Fs with a short height. Now, we can debate if one should be able to say

gmt subplot begin -Rw/e/s/n -JM15c -p130/20 -Fs15c/0

and have subplot compute that height for us. I think that would be desirable. Thoughts?

@PaulWessel PaulWessel added the bug Something isn't working label Apr 4, 2022
@PaulWessel PaulWessel added this to the 6.4.0 milestone Apr 4, 2022
@PaulWessel PaulWessel self-assigned this Apr 4, 2022
@maxrjones
Copy link
Member

Wouldn't gmt subplot begin -Rw/e/s/n -JM15c -p130/20 -Fs15c/? or gmt subplot begin -Rw/e/s/n -JM15c -p130/20 -Fs15c/ be more inline with auto-computation elsewhere?

@PaulWessel
Copy link
Member Author

I think we only use ? inside subplots or inside insets, not "outside", i.e., before we create them. Contrast with -JX15c/0 which will compute the y based on xscale and y-range. But perhaps these are really the same things.

PaulWessel added a commit that referenced this issue Apr 5, 2022
@seisman seisman modified the milestones: 6.4.0, 6.5.0 Jun 25, 2022
@PaulWessel PaulWessel removed this from the 6.5.0 milestone Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants