GenericMappingTools / GenericMappingTools/gmt

3-D perspective views in subplots

Open
#6,517 2 comments 0 reactions 1 assignee Claimed by @PaulWessel View on GitHub
bug
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

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](https://user-images.githubusercontent.com/26473567/161585221-f8a9ec73-896d-4373-bfaf-bd2a90714686.jpg)

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](https://user-images.githubusercontent.com/26473567/161585932-f526eec0-3271-4f1a-bef0-36c7b565237b.jpg)

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.