diff --git a/@miSim/plotConnections.m b/@miSim/plotConnections.m index 1cc6eea..8629924 100644 --- a/@miSim/plotConnections.m +++ b/@miSim/plotConnections.m @@ -32,10 +32,8 @@ function obj = plotConnections(obj) end % Copy to other plots - if size(obj.spatialPlotIndices, 2) > 1 - for ii = 2:size(obj.spatialPlotIndices, 2) - o = [o, copyobj(o(:, 1), obj.f.Children(1).Children(obj.spatialPlotIndices(ii)))]; - end + for ii = 2:size(obj.spatialPlotIndices, 2) + o = [o, copyobj(o(:, 1), obj.f.Children(1).Children(obj.spatialPlotIndices(ii)))]; end obj.connectionsPlot = o; diff --git a/@miSim/plotTrails.m b/@miSim/plotTrails.m index 4666125..8b06d26 100644 --- a/@miSim/plotTrails.m +++ b/@miSim/plotTrails.m @@ -19,8 +19,12 @@ function obj = plotTrails(obj) hold(obj.f.Children(1).Children(obj.spatialPlotIndices(1)), 'off'); end - % Copy trails to other figures? - obj.trailPlot = o; + % Copy to other plots + for ii = 2:size(obj.spatialPlotIndices, 2) + o = [o, copyobj(o(:, 1), obj.f.Children(1).Children(obj.spatialPlotIndices(ii)))]; + end % Add legend? + + obj.trailPlot = o; end \ No newline at end of file diff --git a/@miSim/updatePlots.m b/@miSim/updatePlots.m index a07ffa9..a4dd40e 100644 --- a/@miSim/updatePlots.m +++ b/@miSim/updatePlots.m @@ -40,10 +40,12 @@ function [obj] = updatePlots(obj) end % Update agent trails - for ii = 1:size(obj.agents, 1) - obj.trailPlot(ii).XData(obj.timestepIndex) = obj.posHist(ii, obj.timestepIndex, 1); - obj.trailPlot(ii).YData(obj.timestepIndex) = obj.posHist(ii, obj.timestepIndex, 2); - obj.trailPlot(ii).ZData(obj.timestepIndex) = obj.posHist(ii, obj.timestepIndex, 3); + for jj = 1:size(obj.spatialPlotIndices, 2) + for ii = 1:size(obj.agents, 1) + obj.trailPlot((jj - 1) * size(obj.agents, 1) + ii).XData(obj.timestepIndex) = obj.posHist(ii, obj.timestepIndex, 1); + obj.trailPlot((jj - 1) * size(obj.agents, 1) + ii).YData(obj.timestepIndex) = obj.posHist(ii, obj.timestepIndex, 2); + obj.trailPlot((jj - 1) * size(obj.agents, 1) + ii).ZData(obj.timestepIndex) = obj.posHist(ii, obj.timestepIndex, 3); + end end drawnow; diff --git a/geometries/@spherical/plotWireframe.m b/geometries/@spherical/plotWireframe.m index 9917ba7..1e4fbb0 100644 --- a/geometries/@spherical/plotWireframe.m +++ b/geometries/@spherical/plotWireframe.m @@ -28,7 +28,7 @@ function [obj, f] = plotWireframe(obj, ind, f) o = plot3(f.CurrentAxes, X, Y, Z, '-', 'Color', obj.tag.color, 'LineWidth', 2); else hold(f.Children(1).Children(ind(1)), "on"); - o = plot3(f.Children(1).Children(ind(1)), X, Y, Z, '-', 'Color', obj.tag.color, 'LineWidth', 2); + o = plot3(f.Children(1).Children(ind(1)), X, Y, Z, '-', 'Color', obj.tag.color, 'LineWidth', 1); hold(f.Children(1).Children(ind(1)), "off"); end