comparison scripts/plot/scatter.m @ 17198:df4c4b7708a4

Add titles and clean-up plotting %!demos. * scripts/plot/area.m, scripts/plot/axis.m, scripts/plot/bar.m, scripts/plot/barh.m, scripts/plot/clabel.m, scripts/plot/colorbar.m, scripts/plot/comet.m, scripts/plot/comet3.m, scripts/plot/contour.m, scripts/plot/contour3.m, scripts/plot/contourf.m, scripts/plot/cylinder.m, scripts/plot/ellipsoid.m, scripts/plot/errorbar.m, scripts/plot/ezplot.m, scripts/plot/ezplot3.m, scripts/plot/ezpolar.m, scripts/plot/feather.m, scripts/plot/fplot.m, scripts/plot/hold.m, scripts/plot/isosurface.m, scripts/plot/legend.m, scripts/plot/loglog.m, scripts/plot/loglogerr.m, scripts/plot/mesh.m, scripts/plot/meshc.m, scripts/plot/meshz.m, scripts/plot/patch.m, scripts/plot/pcolor.m, scripts/plot/pie.m, scripts/plot/pie3.m, scripts/plot/plot.m, scripts/plot/plot3.m, scripts/plot/polar.m, scripts/plot/rectangle.m, scripts/plot/ribbon.m, scripts/plot/rose.m, scripts/plot/scatter.m, scripts/plot/scatter3.m, scripts/plot/semilogx.m, scripts/plot/semilogxerr.m, scripts/plot/semilogy.m, scripts/plot/semilogyerr.m, scripts/plot/sombrero.m, scripts/plot/stem3.m, scripts/plot/surf.m, scripts/plot/surfc.m, scripts/plot/surfl.m, scripts/plot/title.m, scripts/plot/waterfall.m: Add titles and clean-up plotting %!demos.
author Rik <rik@octave.org>
date Tue, 06 Aug 2013 14:34:20 -0700
parents eaab03308c0b
children 87ba70043bfc
comparison
equal deleted inserted replaced
17197:b1fd3dc31c42 17198:df4c4b7708a4
97 %!demo 97 %!demo
98 %! clf; 98 %! clf;
99 %! x = randn (100, 1); 99 %! x = randn (100, 1);
100 %! y = randn (100, 1); 100 %! y = randn (100, 1);
101 %! scatter (x, y, 'r'); 101 %! scatter (x, y, 'r');
102 %! title ('Scatter plot with red bubbles'); 102 %! title ('scatter() plot with red bubbles');
103 103
104 %!demo 104 %!demo
105 %! clf; 105 %! clf;
106 %! x = randn (100, 1); 106 %! x = randn (100, 1);
107 %! y = randn (100, 1); 107 %! y = randn (100, 1);
108 %! c = x .* y; 108 %! c = x .* y;
109 %! scatter (x, y, 20, c, 'filled'); 109 %! scatter (x, y, 20, c, 'filled');
110 %! title ('Scatter with colors'); 110 %! title ('scatter() with colored filled bubbles');
111 111
112 %!demo 112 %!demo
113 %! clf; 113 %! clf;
114 %! x = randn (100, 1); 114 %! x = randn (100, 1);
115 %! y = randn (100, 1); 115 %! y = randn (100, 1);
116 %! scatter (x, y, [], sqrt (x.^2 + y.^2)); 116 %! scatter (x, y, [], sqrt (x.^2 + y.^2));
117 %! title ('Scatter plot with bubble color determined by distance from origin'); 117 %! title ({'scatter() plot'; ...
118 %! 'bubble color determined by distance from origin'});
119
120 %!demo
121 %! clf;
122 %! rand_10x1_data5 = [0.777753, 0.093848, 0.183162, 0.399499, 0.337997, 0.686724, 0.073906, 0.651808, 0.869273, 0.137949];
123 %! rand_10x1_data6 = [0.37460, 0.25027, 0.19510, 0.51182, 0.54704, 0.56087, 0.24853, 0.75443, 0.42712, 0.44273];
124 %! x = rand_10x1_data5;
125 %! y = rand_10x1_data6;
126 %! s = 10 - 10*log (x.^2 + y.^2);
127 %! h = scatter (x, y, [], 'r', 's');
128 %! title ({'scatter() plot'; ...
129 %! 'marker is square, color is red'});
130
131 %!demo
132 %! clf;
133 %! rand_10x1_data3 = [0.42262, 0.51623, 0.65992, 0.14999, 0.68385, 0.55929, 0.52251, 0.92204, 0.19762, 0.93726];
134 %! rand_10x1_data4 = [0.020207, 0.527193, 0.443472, 0.061683, 0.370277, 0.947349, 0.249591, 0.666304, 0.134247, 0.920356];
135 %! x = rand_10x1_data3;
136 %! y = rand_10x1_data4;
137 %! s = 10 - 10*log (x.^2 + y.^2);
138 %! h = scatter (x, y, [], 'r', 's', 'filled');
139 %! title ({'scatter() plot'; ...
140 %! 'marker is square, marker is filled, color is red'});
118 141
119 %!demo 142 %!demo
120 %! clf; 143 %! clf;
121 %! rand_10x1_data1 = [0.171577, 0.404796, 0.025469, 0.335309, 0.047814, 0.898480, 0.639599, 0.700247, 0.497798, 0.737940]; 144 %! rand_10x1_data1 = [0.171577, 0.404796, 0.025469, 0.335309, 0.047814, 0.898480, 0.639599, 0.700247, 0.497798, 0.737940];
122 %! rand_10x1_data2 = [0.75495, 0.83991, 0.80850, 0.73603, 0.19360, 0.72573, 0.69371, 0.74388, 0.13837, 0.54143]; 145 %! rand_10x1_data2 = [0.75495, 0.83991, 0.80850, 0.73603, 0.19360, 0.72573, 0.69371, 0.74388, 0.13837, 0.54143];
123 %! x = rand_10x1_data1; 146 %! x = rand_10x1_data1;
124 %! y = rand_10x1_data2; 147 %! y = rand_10x1_data2;
125 %! s = 10 - 10*log (x.^2 + y.^2); 148 %! s = 10 - 10*log (x.^2 + y.^2);
126 %! h = scatter (x, y, s, s, 's', 'filled'); 149 %! h = scatter (x, y, s, s, 's', 'filled');
127 %! title ({'Scatter plot with filled square markers', ... 150 %! title ({'scatter() plot with filled square markers', ...
128 %! 'size and color of markers determined by algorithm'}); 151 %! 'size and color of markers determined by algorithm'});
129
130 %!demo
131 %! clf;
132 %! rand_10x1_data3 = [0.42262, 0.51623, 0.65992, 0.14999, 0.68385, 0.55929, 0.52251, 0.92204, 0.19762, 0.93726];
133 %! rand_10x1_data4 = [0.020207, 0.527193, 0.443472, 0.061683, 0.370277, 0.947349, 0.249591, 0.666304, 0.134247, 0.920356];
134 %! x = rand_10x1_data3;
135 %! y = rand_10x1_data4;
136 %! s = 10 - 10*log (x.^2 + y.^2);
137 %! h = scatter (x, y, [], 'r', 's', 'filled');
138
139 %!demo
140 %! clf;
141 %! rand_10x1_data5 = [0.777753, 0.093848, 0.183162, 0.399499, 0.337997, 0.686724, 0.073906, 0.651808, 0.869273, 0.137949];
142 %! rand_10x1_data6 = [0.37460, 0.25027, 0.19510, 0.51182, 0.54704, 0.56087, 0.24853, 0.75443, 0.42712, 0.44273];
143 %! x = rand_10x1_data5;
144 %! y = rand_10x1_data6;
145 %! s = 10 - 10*log (x.^2 + y.^2);
146 %! h = scatter (x, y, [], 'r', 's');
147 152
148 %!demo 153 %!demo
149 %! clf; 154 %! clf;
150 %! k = 1; 155 %! k = 1;
151 %! for m = [1, 3] 156 %! for m = [1, 3]