MATLAB Spirograph Animations with Grid Lines

Click For Summary

Discussion Overview

The discussion revolves around a technical issue in MATLAB related to creating spirograph animations using the comet function and incorporating grid lines into the visual output. Participants explore the interaction between these commands and the resulting graphical behavior.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes a problem where using the "grid" command causes the graph to disappear when running the comet command.
  • Another participant suggests that the figure command should allow for drawing onto the previous graph without needing to run the program twice.
  • A third participant reiterates the suggestion to use the figure command and encourages checking the help documentation for the "hold on" command.
  • One participant proposes that for more advanced adjustments, the set() and get() commands could be explored, while noting that for basic needs, 'hold on' and 'hold off' should suffice.

Areas of Agreement / Disagreement

Participants express differing views on the necessity of running the program multiple times and the effectiveness of the hold command, indicating that the discussion remains unresolved regarding the best approach to achieve the desired outcome.

Contextual Notes

Some assumptions about the use of MATLAB commands and their interactions are not fully explored, and there may be limitations related to specific versions of MATLAB or graphical settings that are not addressed.

abercrombiems02
Messages
114
Reaction score
0
I have a small technical problem in MATLAB. I am trying to use comet to make an animated path of this spirograph program I've made. I'd also like to add some grid lines however my problem is the following. If i run the comet command everything looks great and works fine, but if I then use a "grid" or "grid on" command, my whole graph disappears. If I try either of the grid commands frist, they are instantly removed when the comet line runs. The only solution I have is to use the hold on command and run the program twice? Any suggestions?
 
Physics news on Phys.org
there' is a figure command to say hold so that you draw onto the previous graph...but you shouldn't have to run it twice. It should draw overlap.
 
neurocomp2003 said:
there' is a figure command to say hold so that you draw onto the previous graph...but you shouldn't have to run it twice. It should draw overlap.

type "help hold on" or "help hold".
 
If you want to get even more technical (don't bother unless you want to do anything fancy), you can check out the set() and get() commands to learn how to adjust axis variables and settings.

For simple things, 'hold on' and 'hold off' should work fine.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K