-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfig_open.m
21 lines (21 loc) · 959 Bytes
/
fig_open.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function [fig1,ax1,dcm_obj] = fig_open()
set(0,'defaultfigurecolor',[1 1 1]) % white background
set(0,'defaultaxesfontname','cambria math') % beautify the axes a bit
scrn_size = get(0,'ScreenSize'); % get size of screen
shrink_pct = 0.1; % shrink the figure by 10%
%
fig1 = figure('Visible','off','DefaultAxesFontSize',20,'Position',...
[scrn_size(1)+(scrn_size(3)*shrink_pct) scrn_size(2)+(scrn_size(4)*shrink_pct)...
scrn_size(3)-(scrn_size(3)*2*shrink_pct) scrn_size(4)-(scrn_size(4)*2*shrink_pct)]); % shrinking the figure
%
ax1 = gca;
dcm_obj = datacursormode(fig1); % enable control of datatips
% set(dcm_obj,'UpdateFcn',@myupdatefcn) % this will be used to configure
% data tips
set(ax1,'fontsize',22,'Color',[0.8 0.8 0.8],'gridcolor',[1 1 1],'gridalpha',0.9) % set the axis color
% to compliment the white background
%
xlabel('Time [Day HH:MM]') % x-axis date label
hold all
grid on % grid for more contrast in the axes
end