Skip to content

Commit ffda835

Browse files
authored
Merge pull request #71 from OSU-LRAM/Review-Branch--Code-for-plotting-DA-for-systems-with-three-shape-variables
Fixed plotting bugs
2 parents 26f7386 + 0a8609b commit ffda835

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

ProgramFiles/sys_draw_fcns/CCF_draw.m

100644100755
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@
5252
H = cat(1,s.(['DA' CCF_addendum])...
5353
,s.(['DA_optimized' CCF_addendum]));
5454

55-
if n_dim == 2
55+
if n_dim == 2
5656

5757
h1name = 'DA';
5858
h2name = 'DA_optimized';
5959

6060
h1 = cell(n_g,1);
6161
h2 = cell(n_g,1);
6262

63-
if ~strcmp(shch,'null')
63+
if ~strcmp(shch,'null')
6464

6565
for i = 1:numel(p.phi_locus)
6666

@@ -75,8 +75,9 @@
7575
end
7676

7777
zdata = cat(1,h1,h2);
78-
end
79-
78+
end
79+
80+
8081
end
8182

8283
case 'dA'
@@ -195,7 +196,7 @@
195196
% H{function_number}(singularity_location) = NaN;
196197
%
197198
% end
198-
if n_dim==2
199+
if n_dim==2
199200
%Plot the constraint curvature function
200201
meshhandle = surf(ax,grid{:},H{function_number});
201202
end
@@ -264,14 +265,14 @@
264265
end
265266
end
266267

267-
meshhandle=pcolor(xgrid,ygrid,-curvatureproj);
268+
meshhandle=pcolor(xgrid,ygrid,-curvatureproj,'Parent',ax);
268269
meshhandle.ZData=zgrid;
269270

270271
hold on
271272

272273
colormap(Colorset.colormap);
273-
shading interp
274-
view(3)
274+
shading(ax,'interp')
275+
view(ax,3)
275276

276277

277278
end
@@ -284,7 +285,7 @@
284285
end
285286
if n_dim==3
286287
meshhandle.FaceAlpha=0.9;
287-
plot3(p.phi_locus_full{i}.shape(:,1),p.phi_locus_full{i}.shape(:,2),p.phi_locus_full{i}.shape(:,3),'b','LineWidth',6);
288+
line('XData',p.phi_locus_full{i}.shape(:,1),'YData',p.phi_locus_full{i}.shape(:,2),'ZData',p.phi_locus_full{i}.shape(:,3),'Color',Colorset.spot,'LineWidth',6,'parent',ax);
288289
end
289290
end
290291

@@ -377,8 +378,8 @@
377378
end
378379

379380

380-
meshhandle=contourslice(grid{2,1},grid{1,1},grid{3,1},curvatureproj,xgrid,ygrid,zgrid);
381-
view(3)
381+
meshhandle=contourslice(grid{2,1},grid{1,1},grid{3,1},curvatureproj,xgrid,ygrid,zgrid,'parent',ax);
382+
view(ax,3)
382383

383384

384385
end
@@ -390,8 +391,7 @@
390391
overlay_shape_change_2d(ax,p,plot_info.stretch,s.convert);
391392
end
392393
if n_dim==3
393-
hold on
394-
plot3(p.phi_locus_full{i}.shape(:,1),p.phi_locus_full{i}.shape(:,2),p.phi_locus_full{i}.shape(:,3),'r','LineWidth',6);
394+
line('XData',p.phi_locus_full{i}.shape(:,1),'YData',p.phi_locus_full{i}.shape(:,2),'ZData',p.phi_locus_full{i}.shape(:,3),'Color',Colorset.spot,'LineWidth',6,'parent',ax);
395395
end
396396

397397
end

ProgramFiles/sys_draw_fcns/vfield_draw.m

100644100755
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
function plot_info = vfield_draw(s,p,plot_info,sys,shch,resolution)
22

3+
%Get the configuration file, and extract the Colorpath
4+
configfile = 'sysplotter_config';
5+
configfile = fullfile(fileparts(mfilename('fullpath')),'..',configfile);
6+
load(configfile,'Colorset');
7+
38
%Vector field list
49
vfield_list = {'X','Y','T','Xopt','Yopt','Topt'};
510

@@ -263,8 +268,7 @@
263268
overlay_shape_change_2d(ax,p,plot_info.stretch,s.convert);
264269
end
265270
if n_dim==3
266-
hold on
267-
plot3(p.phi_locus_full{i}.shape(:,1),p.phi_locus_full{i}.shape(:,2),p.phi_locus_full{i}.shape(:,3),'r','LineWidth',6);
271+
line('XData',p.phi_locus_full{i}.shape(:,1),'YData',p.phi_locus_full{i}.shape(:,2),'ZData',p.phi_locus_full{i}.shape(:,3),'Color',Colorset.spot,'LineWidth',6,'parent',ax);
268272
end
269273

270274
end

UserFiles/GenericUser/Systems/sysf_four_link_lowRe.m

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
s.grid_range = [-1,1,-1,1,-1,1]*2;
7171

7272
%densities for various operations
73-
s.density.vector = [21 21 21]; %density to display vector field
73+
s.density.vector = [10 10 10]; %density to display vector field
7474
s.density.scalar = [21 21 21]; %density to display scalar functions
7575
s.density.eval = [21 21 21]; %density for function evaluations
7676
s.density.metric_eval = [11 11 11]; %density for metric evaluation

0 commit comments

Comments
 (0)