altmany / altmany/export_fig

Image cropped to smaller size when saving PNGs on MDCS

Đang mở
#98 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
internal Matlab bug
Ngôn ngữ chính
MATLAB
Star
1.4k
Fork
366
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello!

After generating figures in headless mode on our MDCS cluster, I call export_fig to save some images as PNG. However, after doing so, the images get cropped. I can run the same script on my local client and get the correct result.

My test code is as follows:

``` Matlab
%%% This script is to help with debugging figure generation on MDCS.
savePath = '/Save/Path/';
name = fullfile(savePath, 'testPNGgen');
figPos=[66 1 1855 1001];

f = figure('Position', figPos);
set(f, 'PaperUnits', 'points');
set(f, 'PaperSize', [1790 1001]);
set(f, 'PaperPosition', [66 1 1855 1001]);
plot(randn(1,10), randn(1,10));
export_fig(name, '-png', '-painters', f)
```

I have tried the following debug steps, all without success:
- Use '-m0.5' to try to shrink figure pixel dimensions. This just makes the cropped image smaller.
- Include `set(f, 'PaperPositionMode', 'manual');` before plotting the figure. No change to the cropped image.

I can size things appropriately using print:

``` Matlab
print(f, name, '-dpng', '-painters', '-r300')
```

This results in the full image, but without all the improvements export_fig provides.

Any help on this matter would be greatly appreciated. I am happy to run tests on my cluster if more debug information is required or desired.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.