I am using GMT6.6.0dev in MATLAB2023a on Windows 10. I found that the canvas is not correct. For example, I generate a PNG image. The code is as follows.
#Bash code
gmt begin test1 png
gmt coast -R-130/-50/20/60 -JM15c -Bafg -A5000 -W1/0.5p,black
gmt end show
%MATLAB code
gmt('begin test2 png');
gmt('coast -R-130/-50/20/60 -JM15c -Bafg -A5000 -W1/0.5p,black');
gmt('end show');
gmt('destroy');
The Bash code runs correctly as shown below.
However, the results of the MATLAB code clearly do not make sense. The manual shows that the default canvas size for GMT is 11.6 meters wide by 11.6 meters high, and that unused white areas are automatically cropped when the final image file is generated, so the user doesn’t need to worry about the size.
So, what is causing the GMT anomaly in MATLAB? How can I fix this problem? Could someone please help me?