|
413 | 413 | % 31/03/25: (3.49) Fixed(?) -transparency in PDF/EPS files (issue #401); override Matlab's default Title & Creator meta-data (issue #402) |
414 | 414 | % 31/03/25: (3.50) Revert bad fix for issue #401 |
415 | 415 | % 08/07/25: (3.51) Fixed: figure with non-default colormap exported with default colormap in some cases (issue #389) |
| 416 | +% 07/09/25: (3.52) Fixed: sgtitle was cropped in transparent PDF/EPS output (thanks @JohanWesto) |
416 | 417 | %} |
417 | 418 |
|
418 | 419 | if nargout |
|
450 | 451 | [fig, options] = parse_args(nargout, fig, argNames, varargin{:}); |
451 | 452 |
|
452 | 453 | % Check for newer version and exportgraphics/copygraphics compatibility |
453 | | - currentVersion = 3.51; |
| 454 | + currentVersion = 3.52; |
454 | 455 | if options.version % export_fig's version requested - return it and bail out |
455 | 456 | imageData = currentVersion; |
456 | 457 | return |
|
1141 | 1142 | try hCBs = getappdata(hAxes,'LayoutPeers'); catch, hCBs=[]; end %issue #383 |
1142 | 1143 | hCBs = unique([findall(fig,'tag','Colorbar'), hCBs]); |
1143 | 1144 | hCbTxt = fixBlackText(hCBs,'Title'); % issue #382 |
| 1145 | + |
| 1146 | + % Fix subplot grid title (sgtitle) issue #406 |
| 1147 | + hSpTxt = findobj(fig,'Type','subplottext'); |
| 1148 | + hSpTxt = fixBlackText(hSpTxt,''); |
1144 | 1149 | end |
1145 | 1150 | % Generate an eps |
1146 | 1151 | print2eps(tmp_nam, fig, options, printArgs{:}); %winopen(tmp_nam) |
|
1158 | 1163 | set(hZrs, 'Color', [0,0,0]); |
1159 | 1164 | set(hTitle,'Color',[0,0,0]); |
1160 | 1165 | set(hCbTxt,'Color',[0,0,0]); |
| 1166 | + set(hSpTxt,'Color',[0,0,0]); |
1161 | 1167 | end |
1162 | 1168 | %} |
1163 | 1169 | % Restore the figure's previous background color (if modified) |
@@ -2596,7 +2602,11 @@ function change_rgb_to_cmyk(fname) % convert RGB => CMYK within an EPS file |
2596 | 2602 |
|
2597 | 2603 | function hText = fixBlackText(hObject, propName) |
2598 | 2604 | try |
2599 | | - hText = get(hObject, propName); |
| 2605 | + if isempty(propName) %issue #406 |
| 2606 | + hText = hObject; |
| 2607 | + else |
| 2608 | + hText = get(hObject, propName); |
| 2609 | + end |
2600 | 2610 | try hText = [hText{:}]; catch, end %issue #383 |
2601 | 2611 | for idx = numel(hText) : -1 : 1 |
2602 | 2612 | hThisText = hText(idx); |
|
0 commit comments