Skip to content

Commit a1e416f

Browse files
committed
-
1 parent 4abb97f commit a1e416f

File tree

2 files changed

+14
-33
lines changed

2 files changed

+14
-33
lines changed

source/plot_2dgridded.m

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
% 18/11/15: added ps rendering fix ... hopefuly ...
4747
% for MUTLAB version shenanigans
4848
% *** VERSION 1.16 ********************************************
49+
% 24/07/17: saving as PDF rather than PS
50+
% *** VERSION 1.17 ********************************************
4951
%
5052
% ***********************************************************************
5153

@@ -54,7 +56,7 @@
5456
% *********************************************************************** %
5557
%
5658
% set version!
57-
par_ver = 1.16;
59+
par_ver = 1.17;
5860
% set function name
5961
str_function = mfilename;
6062
% close open windows
@@ -64,10 +66,6 @@
6466
eval(POPT);
6567
% set date
6668
str_date = [datestr(date,11), datestr(date,5), datestr(date,7)];
67-
% determine whcih stupid version of MUTLAB we are using
68-
tmp_mutlab = version('-release');
69-
str_mutlab = tmp_mutlab(1:4);
70-
par_mutlab = str2num(str_mutlab);
7169
%
7270
% *** copy passed parameters ******************************************** %
7371
%
@@ -77,7 +75,7 @@
7775
data_id = PDATAID;
7876
data_title = PDATATITLE;
7977
% set default plot name
80-
if isempty(data_id),
78+
if isempty(data_id)
8179
data_id = str_function;
8280
end
8381
%
@@ -94,7 +92,7 @@
9492
% set plot limits
9593
% NOTE: if limits are not explicitl specified,
9694
% data > threshold is excluded (NaN) in finding the (min,max) limits
97-
if exist('PDATALIMS','var'),
95+
if exist('PDATALIMS','var')
9896
data_min = PDATALIMS(1);
9997
data_max = PDATALIMS(2);
10098
data(find(data(:,:) < data_min)) = data_min;
@@ -132,7 +130,6 @@
132130
% NOTE: explicitly specify renderer is using useless recent version
133131
scrsz = get(0,'ScreenSize');
134132
hfig = figure('Position',[((1 - plot_dscrsz)/2)*plot_dscrsz*scrsz(3) (1 - plot_dscrsz)*plot_dscrsz*scrsz(4) 1.1*plot_dscrsz*scrsz(4) plot_dscrsz*scrsz(4)]);
135-
if (par_mutlab > 2015), hfig.Renderer='Painters'; end
136133
clf;
137134
% define plotting regions
138135
fh(1) = axes('Position',[0 0 1 1],'Visible','off');
@@ -224,13 +221,7 @@
224221
% *** PRINT PLOT ******************************************************** %
225222
%
226223
set(gcf,'CurrentAxes',fh(1));
227-
set(gcf,'renderer','painters');
228-
filename = data_id;
229-
if (par_mutlab > 2015),
230-
print('-dpsc2', '-bestfit', [filename '.' str_date '.ps']);
231-
else
232-
print('-dpsc2', [filename '.' str_date '.ps']);
233-
end
224+
exportgraphics(gcf,[str_filename '.' str_date '.pdf'],'BackgroundColor','none','ContentType','vector');
234225
%
235226
% *********************************************************************** %
236227

source/plot_2dgridded2.m

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
% *** VERSION 0.92 ********************************************
4848
% 19/01/06: bug fix of defalt plotting parameters
4949
% *** VERSION 0.93 ********************************************
50+
% 24/07/17: saving as PDF rather than PS
51+
% *** VERSION 0.94 ********************************************
5052
%
5153
% ***********************************************************************
5254

@@ -57,18 +59,14 @@
5759
% *** INITIALIZE ******************************************************** %
5860
%
5961
% set version!
60-
par_ver = 0.93;
62+
par_ver = 0.94;
6163
% set function name
6264
str_function = mfilename;
6365
str_function(find(str_function(:)=='_')) = '-';
6466
% close open windows
6567
close all;
6668
% set date
6769
str_date = [datestr(date,11), datestr(date,5), datestr(date,7)];
68-
% determine whcih stupid version of MUTLAB we are using
69-
tmp_mutlab = version('-release');
70-
str_mutlab = tmp_mutlab(1:4);
71-
par_mutlab = str2num(str_mutlab);
7270
% check for make_cmap
7371
if ~(exist('make_cmap', 'file') == 2)
7472
disp([' ']);
@@ -83,7 +81,7 @@
8381
data_in = PDATAIN;
8482
data_lims = PDATALIMS;
8583
data_col = PDATACOL;
86-
if ~exist('OSTRUCTTEXT','var'),
84+
if ~exist('OSTRUCTTEXT','var')
8785
str_title = 'hello';
8886
str_filename = ['myplot' str_date];
8987
end
@@ -106,8 +104,8 @@
106104
% set n colors
107105
c_max =256;
108106
% set color scale
109-
if isempty(data_col),
110-
colorbar_name = 'parula';
107+
if isempty(data_col)
108+
colorbar_name = 'inferno';
111109
else
112110
colorbar_name = data_col;
113111
end
@@ -230,7 +228,6 @@
230228
% NOTE: explicitly specify renderer is using useless recent version
231229
scrsz = get(0,'ScreenSize');
232230
hfig = figure('Position',[((1 - plot_dscrsz)/2)*plot_dscrsz*scrsz(3) (1 - plot_dscrsz)*plot_dscrsz*scrsz(4) 1.1*plot_dscrsz*scrsz(4) plot_dscrsz*scrsz(4)]);
233-
if (par_mutlab > 2015), hfig.Renderer='Painters'; end
234231
clf;
235232
% define plotting regions
236233
fh(1) = axes('Position',[0 0 1 1],'Visible','off');
@@ -252,9 +249,7 @@
252249
caxis([data_min data_max]);
253250
set(gca,'PlotBoxAspectRatio',[1.0 plot_xy_scaling*1.0 1.0]);
254251
axis([0.0 double(xmax) 0.0 double(ymax)]);
255-
if (par_mutlab > 2016),
256-
xtickangle(par_xtickangle);
257-
end
252+
xtickangle(par_xtickangle);
258253
set(gca,'XLabel',text('String',str_xlabel,'FontSize',18),'XTick',[0.5:1:xmax-0.5],'XTickLabel',v_xticks,'fontsize',9*(12/xmax)^0.5);
259254
set(gca,'YLabel',text('String',str_ylabel,'FontSize',18),'YTick',[0.5:1:ymax-0.5],'YTickLabel',v_yticks,'fontsize',9*(12/ymax)^0.5);
260255
set(gca,'TickDir','out');
@@ -326,12 +321,7 @@
326321
% *** PRINT PLOT ******************************************************** %
327322
%
328323
set(gcf,'CurrentAxes',fh(1));
329-
set(gcf,'renderer','painters');
330-
if (par_mutlab > 2015),
331-
print('-dpsc2', '-bestfit', [str_filename '.ps']);
332-
else
333-
print('-dpsc2', [str_filename '.ps']);
334-
end
324+
exportgraphics(gcf,[str_filename '.' str_date '.pdf'],'BackgroundColor','none','ContentType','vector');
335325
%
336326
% *********************************************************************** %
337327

0 commit comments

Comments
 (0)