Horses for courses.
If I understand correctly this Wikipedia Spirograph article indicates that you are interested in creating various types of roulette curves. This implies that you want to create a curve that corresponds to a mathematical equation [e.g. $r^2 = k,$ or $x^2 + y^2 = k,$ or $r^2 = 2\cos(2\theta)$].
Under the assumption that you will always be able to supply the mathematical equation that corresponds to the image that you are trying to display, your query can be split into two questions:
For insertion of an image into a pdf file that can be printed or stored (e.g. electronic math notebook), I recommend starting with LaTeX.
From this foundation, you have two choices. The first choice is to create an image using math software that does not dovetail with LaTeX. Then, convert the image into (for example) a jpeg file (i.e. *.jpg) and then issue the LaTeX commands to insert the graphics file into your pdf file.
Within LaTeX, the other choice is to find a graphics package that dovetails with LaTex - see CTAN. For specialized graphics packages you can search for "graphics" from the opening screen at CTAN. However, there are generally three all purpose Latex-plug-in graphics packages: PSTricks, Asymptote, and PGF-Tikz. All three of these packages are capable of creating mathematical graphs directly into your LaTeX generated pdf file.
All three of these all purpose Latex graphics packages have significant learning curves, and are (perhaps) oriented towards LaTeX users with different skills. What most LaTeX users (me included) do is to spend a brief amount of time exploring each one, including the software's gallery of samples, and documentation. Then, the user will typically choose only one of the three, and focus on mastering that particular package.
This begs the question of how to produce various mathematical images totally outside of Latex. I am largely ignorant in this area. In fact, I stumbled on this query simply trying to educate myself.
I decided to start by searching mathSE for all queries with the [math-software] tag. Once I complete that, I will then start with Wikipedia. So far, my two ground-zero Wikipedia articles are Plotting Software and Math Software.
Once I gather links by exhausting mathSE and my two ground zero links then I'll explore the corresponding packages. One key issue to consider is whether it is acceptable to use the application online through a browswer, or whether you wish to download an application for local use. A peripheral issue is compatibility with your operating System (i.e. Windows, Linux derivative, or Apple-Mac).
Another issue is usage. Do you wish to create animated graphics (e.g. *.png or *.gif files)? Further, are you going to collect the graphical images into a folder on your hard drive? Alternatively, do you simply want a method of quickly creating a temporary math image that you don't plan to store. Examples of temporary usage include helping you to understand a specific math problem and illustrating a mathSE query or answer with an embedded image.