File: tsgPlotPoints2D.m

package info (click to toggle)
tasmanian 8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,852 kB
  • sloc: cpp: 34,523; python: 7,039; f90: 5,080; makefile: 224; sh: 64; ansic: 8
file content (45 lines) | stat: -rw-r--r-- 760 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function tsgPlotPoints2D(points, fig)
%
% plotGrid2D(points, fig)
%
% plots two dimensional points in a figure
%
% INPUT:
%
% points: (matrix number_of_points X 2)
%          points created using tsgMakeXXX(...) command with iDim = 2
%
% fig: (optional integer figure number)
%      the plot will show on the given figure
%      by default everything is plotted on figure 1
%

if (nargin < 2)
    fig = 1;
end

if (size(points, 2) ~= 2)
    disp(['ERROR: size of q should be n by 2']);
	return
end

qm = min(points);
qM = max(points);

qD = (qM - qm);

qI = 0.05 * qD;

qm = qm - qI;
qM = qM + qI;

figure(fig)
hold on
for i = 1:size(points,1)
	pl = plot(points(i,1), points(i,2), '.');
    set(pl, 'MarkerSize', 15);
end

axis([qm(1),qM(1),qm(2),qM(2)]);

end