annotate +parametrization/place_label.m @ 577:e45c9b56d50d feature/grids

Add an Empty grid class The need turned up for the flexural code when we may or may not have a grid for the open water and want to plot that solution. In case there is no open water we need an empty grid to plot the empty gridfunction against to avoid errors.
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 07 Sep 2017 09:16:12 +0200
parents 0e198af1184b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
358
5cb99f56f55e Added some utility functions. Improved some documentation.
Jonatan Werpers <jonatan@werpers.com>
parents: 0
diff changeset
1 % 'left' | 'center' | 'right'
5cb99f56f55e Added some utility functions. Improved some documentation.
Jonatan Werpers <jonatan@werpers.com>
parents: 0
diff changeset
2 % 'baseline' | 'top' | 'cap' | 'middle' | 'bottom'
0
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
3 function place_label(pt,str,horzAl,vertAl)
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
4 default_arg('horzAl','center');
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
5 default_arg('vertAl', 'middle');
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
6
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
7 x = pt(1);
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
8 y = pt(2);
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
9 h = text(x,y,str);
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
10 h.HorizontalAlignment = horzAl;
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
11 h.VerticalAlignment = vertAl;
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
12 end