TikZ is a LaTeX library for generating graphics. (Link)
Pricing
Free and open source.
Alternatives
  • Inkscape. When producing complicated shapes, Inkscape is typically easier than TikZ, but the process of exporting from Inkscape after changes to the graphics can take longer.
  • Draw.io.

Creating graphics in TikZ has a steep learning curve (the PDF manual is apparently over a thousand pages), but for simple use cases, such as plotting a function, creating plots in TikZ can be convenient since changes to the graphic can be incorporated simply by re-compiling the LaTeX document.

TikZ also comes with a substantial collection of built-in functions and libraries for generating specific types of diagrams, including

For plotting mathematical functions with nicely formatted axes, you can use the pfgplots package.

If you are trying to plot something “from scratch”, try looking for a library first!