altmany / export_fig

A MATLAB toolbox for exporting publication quality figures
BSD 3-Clause "New" or "Revised" License
1.28k stars 368 forks source link

export_fig producing empty files with new version #340

Closed dwh29 closed 3 years ago

dwh29 commented 3 years ago

I uploaded the latest version of export_fig, but changed nothing else. Now the pdf produced is empty. Any suggestions would be much appreciated. I have pasted in the .m file, but I don't think this is the problem. All was fine with the older version of export_fig.

Here is the file concerned:

% Here we plot Ra_c versus Rs at fixed Ct, tau and sigma in first quadrant
% to produce one of the JFM figures (figure 4).
% The data has been produced already and
% is saved in JFM_fig4_data.mat, so this is just a bunch of plotting
% routines.

loyolagreen = 1/255*[0,104,87];
loyolagray = 1/255*[200,200,200];
orange = 1/255*[25,165,0];
pink = 1/255*[255,20,147];

figure

set(gcf, 'Units', 'Normalized', 'OuterPosition', [0.03, 0.2, 0.88, 0.6]);
set(gcf,'color','w');
fs=15;
% 
 subplot(1,2,1)

arrsize=size(k2_steady_c_arr);
if arrsize(2)>0
    loglog(Rs_steady_arr,Ra_steady_c_arr,'r','LineWidth',2)
    hold on
end

arrsize=size(k2_osc_c_arr);
if arrsize(2)>0
    loglog(Rs_osc_arr,Ra_osc_c_arr,'b','LineWidth',2)
    hold on
end

loglog(Rs_all_arr,Rs_all_arr/tau+27/4,'r--','LineWidth',2)
loglog(Rs_osc_arr,(sigma+tau)/(1+sigma)*Rs_osc_arr + ...
    27/4*(1+tau)*(sigma+tau)/sigma,'b--','LineWidth',2)

% loglog(Rs_osc_arr(202:395),(Rs_osc_arr(202:395)/tau).^(0.5)/Ct, ...
%     '--','Color',pink,'LineWidth',3)%% Original version

loglog(Rs_osc_arr(202:14:395),(Rs_osc_arr(202:14:395)/tau).^(0.5)/Ct, ...
    's','MarkerEdgeColor','m','MarkerSize',8,'LineWidth',3)

% loglog(Rs_osc_arr(60:210),(sigma+tau)*Rs_osc_arr(60:210), ...
%     'c--','LineWidth',2)

xlabel('$Rs$','Interpreter','latex','FontSize',16)
ylabel('$Ra_c$','Interpreter','latex','FontSize',16)
set(gca,'FontSize',16)

subplot(1,2,2)

arrsize=size(k2_steady_c_arr);
if arrsize(2)>0
    loglog(Rs_steady_arr,k2_steady_c_arr,'r','LineWidth',2)
    hold on
end

arrsize=size(k2_osc_c_arr);
if arrsize(2)>0
    loglog(Rs_osc_arr,k2_osc_c_arr,'b','LineWidth',2)
    hold on
end

% loglog(Rs_osc_arr(202:395),(Rs_osc_arr(202:395)/tau).^(0.5),'--', ...
%   'Color',pink,'LineWidth',3) %% Original version

loglog(Rs_osc_arr(202:12:395),(Rs_osc_arr(202:12:395)/tau).^(0.5),'s', ...
    'MarkerEdgeColor','m','MarkerSize',8,'LineWidth',3)

% loglog(Rs_osc_arr(100:210),2*Ct*Rs_osc_arr(100:210), ...
%     'c--','LineWidth',2)

xlabel('$Rs$','Interpreter','latex','FontSize',16)
ylabel('$k_c^2$','Interpreter','latex','FontSize',16)
set(gca,'FontSize',16)

export_fig fig4chk.pdf
zifredder commented 3 years ago

Possibly the same as #318. Try the workarounds mentioned there -- if you haven't already.

dwh29 commented 3 years ago

Thanks for this. I'll give it a try.


David W. Hughes School of Mathematics University of Leeds Leeds LS2 9JT UK

Tel: +44 (0)113 343 5105 Email: @.***

http://www.maths.leeds.ac.uk/~dwh


From: Frederick Zittrell @.> Sent: 06 August 2021 07:14 To: altmany/export_fig @.> Cc: David Hughes [Maths] @.>; Author @.> Subject: Re: [altmany/export_fig] export_fig producing empty files with new version (#340)

Possibly the same as #318https://github.com/altmany/export_fig/issues/318. Try the workarounds mentioned there -- if you haven't already.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/altmany/export_fig/issues/340#issuecomment-894028758, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALUIXX6SQK3WPKRWDT6TDB3T3N4TTANCNFSM5BUMD6GA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

altmany commented 3 years ago

I cannot reproduce on my end so I'm closing the issue. If you wish to reopen, please provide a working code snippet (the one above fails because no data was attached, a simple few lines of code with synthetic data that reproduce the problem will be best, attaching the complete program is not very helpful...)

altmany commented 3 years ago

Note that the recent commit that fixes issue #318 may also be a solution for this issue

bachus34 commented 3 years ago

Hello, I am having the same issue, but only with pdf's. I am running Matlab version '9.11.0.1769968 (R2021b)' on MacOS Big Sur version 11.6, with export_fig version 3.19. I have tried using the workaround #318 and it occasionally works, but particularly doesn't like when I'm exporting multiple file types. Can you please help or provide suggestions? Here's some sample code:

x=[1 2 3 4];
y=[1 2 3 4];

plot(x,y)
xlabel('x');ylabel('y');
set(gcf,'position',[50 300 641 489])
set(gca, 'FontName', 'Helvetica')
set(gca,'FontSize',10) % Sets global axis font size to 14
set(gca,'FontWeight','bold') % Sets global axis font weight
set(gca,'Color','White')
set(gcf,'Color','White')
export_fig('testFigSave','-pdf','-p1','-r288')