File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
plotly/plotlyfig_aux/handlegraphics Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 5151col = 255 * quiver_data .Color ;
5252obj.data{quiverIndex }.line.color = [' rgb(' num2str(col(1 )) ' ,' num2str(col(2 )) ' ,' num2str(col(3 )) ' )' ];
5353
54+ % ------------------------------------------------------------------------%
55+
5456% -quiver line width-%
5557obj.data{quiverIndex }.line.width = 2 * quiver_data .LineWidth ;
5658
115117m = m + 3 ;
116118end
117119
120+ % ------------------------------------------------------------------------%
121+
122+ % -quiver z-%
123+
124+ % check for 3D plot
125+ flag3d = ~isempty(quiver_data .ZData );
126+
127+ if flag3d
128+
129+ % -format data-%
130+ zdata = quiver_data .ZData(: );
131+ wdata = quiver_data .WData(: )*scalefactor ;
132+
133+ % -set 3d data-%
134+ m = 1 ;
135+ for n = 1 : length(ydata )
136+ obj.data{quiverIndex }.z(m ) = zdata(n );
137+ obj.data{quiverIndex }.z(m + 1 ) = zdata(n ) + wdata(n );
138+ obj.data{quiverIndex }.z(m + 2 ) = nan ;
139+ m = m + 3 ;
140+ end
141+
142+ % -scatter 3d type-%
143+ obj.data{quiverIndex }.type = ' scatter3d' ;
144+ end
145+
118146% -------------------------------------------------------------------------%
119147
120148% -quiver barbs-%
154182 for col = 1 : 4
155183 obj.data{quiverIndex }.x(end + 1 ) = barb(1 ,col ); % point 1
156184 obj.data{quiverIndex }.y(end + 1 ) = barb(2 ,col );
185+
186+ if flag3d
187+ obj.data{quiverIndex }.z(end + 1 ) = zdata(n );
188+ end
157189 end
158190 end
159191end
You can’t perform that action at this time.
0 commit comments