# Is it possible to plot a graph of any shape?

In school, I have learnt to plot simple graphs such as $y=x^2$ followed by $y=x^3$.
A grade or two later, I learnt to plot other interesting graphs such as $y=1/x$, $y=\ln x$, $y=e^x$.
I have also recently learnt about trigonometric graphs and circle equations.
In the internet, I have seen users posting graphs of different shapes like a heart-shaped graph and a Batman logo-shaped graph.
I am sure there are numerous more graphs that I have yet to see.

Seeing that the graphs can be shaped into shapes like the Batman logo and a heart brings me to my question: Is it possible to plot a graph of any shape regardless of its complexity? Perhaps, shaped into an outline of a person or a landmark? Why or why not?

• You may wish to study Fractal geometry, whereby fascinatingly complex geometric structures can be generated by very simple expressions, and/or computer programs. You might also enjoy the concepts like the Fourier Transform (which underlies JPEG image compression, like what was used to send images of Pluto back from New Horizons recently) or Wavelets. Those methods essentially determine how to form a complicated image out of simple wave fuctions like cosine waves or wavelet functions. Good luck. – don bright Sep 10 '15 at 2:34
• @donbright Thank you! This will be slightly off-topic, but do you have any recommendations where I can study these online? There are simply too many links when searched in Google. I usually read things up in Wikipedia, but I end up being baffled given my still-narrow knowledge of Mathematics. – ChrisJWelly Sep 10 '15 at 2:40
• You might have some luck googling "fractals high school", many teachers have posted nice "introductory" pages on the web about fractals. Also ViHart on youtube did several vids where she drew fractals with pens and paper. Fourier Transform requires knowledge of cosine but.. I often have luck typing things like "fourier transform for dummies". good luck. – don bright Sep 10 '15 at 3:33
• A nice video is Ptolemy and Homer Simpson which is sort of neat as it shows a picture drawn with "epicycles upon epicycles". – Hurkyl Sep 11 '15 at 8:20
• check out desmos.com – chharvey Sep 12 '15 at 16:04

Simple answer: Yes--simply draw your person or landmark and then superimpose the $xy$-plane on top and suddenly you have all of the points (i.e., coordinates) that need to be filled in to create a plot of your graph.

Now, how you come up with a good (read: not complex) mathematical description of these coordinates (e.g., using a function) is another issue entirely. Depending on the complexity of what you are drawing, you most likely won't get something pretty. For example, consider drawing the fictional character Donkey Kong:

The picture above was generated by Wolfram|Alpha. How complicated is the curve? Well, here you go:

That's pretty horrible. So yes, you can certainly plot whatever you want, but describing your plot effectively using whatever kind of function, parametric equations, etc., may not be very easy or nice in the end.

Added: Given the unexpected popularity of this post (both question and answer(s)), I thought I might add something that some may find helpful or useful. In 2012, I wrote an article entitled Bézier Curves with a Romantic Twist that appeared in the Math Horizons periodical. This piece largely dealt with using lower order Bézier curves (linear and cubic) to construct letters for a person's name on a graphing calculator; in the context of this post, the problem was to plot a graph of letters in the alphabet (along with a heart and parametrically-defined sequence). If you read the article, you will see that the math behind constructing such letters is not all too complicated--my reason for providing the Donkey Kong example was largely to show just how complicated it can be to effectively sketch something with equations.

But sketching letters and the like (as opposed to much more complicated representations like Captain Falcon, Pikachu, Sonic, etc.) is quite manageable. In fact, the avatar for my username even uses a simple construction to spell the word MATH:

For those interested, I will provide the equations I used for the M, the sequence, and the heart (as entered on a TI-89 calculator):

$$\mathrm{M}= \begin{cases} xt1 & = & (1-t)10+11.25t\\ yt1 & = & (1-t)5+12.75t\\ xt2 & = & (1-t)11.25+12.5t\\ yt2 & = & (1-t)12.75+8.875t\\ xt3 & = & (1-t)12.5+13.75t\\ yt3 & = & (1-t)8.875+12.75t\\ xt4 & = & (1-t)13.75+15t\\ yt4 & = & (1-t)12.75+5t\\ \end{cases}$$

$$\mathrm{Heart} = \begin{cases} xt5 & = & 4\sin(t)^3\\ yt5 & = & \frac{1}{2}\bigl(13\cos(t)-5\cos(2t)-2\cos(3t)-\cos(4t)\bigr)+34.2 \end{cases}$$

$$\mathrm{Sequence}= \begin{cases} xt6 & = & t\\ yt6 & = & (3^t+5^t)^{1/t} \end{cases}$$

Of course, the A, T, and H are all similar to the M in that they are drawn using linear Bézier curves. A more interesting letter is something like C or S or even D or B (these will all use at least cubic Bézier curves).

• This self-upvote by Donkey Kong is one of the coolest answer I ever saw. – A.L Sep 10 '15 at 13:51
• – user236182 Sep 10 '15 at 16:13
• Such a wonderful answer. – Harshal Gajjar Sep 10 '15 at 19:33
• FWIW, one reason I chose this curve of Donkey Kong (besides the obvious reason for how it shows how complex sketching with equations can be) is because his thumb's up is, in a way, an affirmative response to OP's question (i.e., is it possible to plot a graph of any shape?). – Daniel W. Farlow Sep 11 '15 at 3:26
• But in another sense, it is completely incorrect that any "graph" corresponds to some equation(s) or other finite string of symbols. Take for exaple all "graphs" consisting of a single horizontal line only. They are in one-to-one correspondence with equations $y=k$ for $k\in\mathbb{R}$ of course. But there is an uncountable number of these horizontal lines. And only a countable number of them can be described in a finite definition. So: If you take a "random" curve corresponding to the tip of the thumb of some ape, the "probability" that the curve corresponds to a "finite" equation, is zero. – Jeppe Stig Nielsen Sep 11 '15 at 8:52

Is it possible to plot a graph of any shape regardless of its complexity?

Definitely not, simply because it is possible to define shapes that are so complex they cannot be computed. More precisely, there exist uncomputable functions $f$, such that no program can compute their graphs $\{(x,y)\mid y=f(x)\}.$

In fact, most functions that map $N \to N$ are uncomputable, in the sense that uncountably many are uncomputable, whereas only countably many are computable (there being uncountably many such functions altogether).

An example would be $f(x)$ defined as the number of $x$-state Busy-Beaver-class Turing machines.

NB: This is contary to all $5$ of the other answers -- perhaps because they assume the graph is supposed to be finite (and hence computable).

• Wow. This is a very interesting answer which contradicts. Are there infinitely many uncomputable functions? – ChrisJWelly Sep 11 '15 at 10:07
• @ChrisJWelly - Not just infinitely many, but uncountably many functions that map naturals to naturals are uncomputable. This is because there are only countably many such functions that are computable, but uncountably many such functions altogether. (I.e., most functions that map $N \to N$ are uncomputable.) Thanks for asking -- I've added this comment to my answer. – r.e.s. Sep 11 '15 at 13:16
• I see. Thank you. I am slightly more convinced with this answer. Afterall, my question asks if any shape is plottable. Since, there are such things as uncomputable functions, that means the answer to my question is indeed a 'no'. May I get the opinion of @DanielW.Farlow on this answer? – ChrisJWelly Sep 11 '15 at 14:57
• @ChrisJWelly r.e.s. points out something important at the very end of his answer: the nature of the graph and whether or not it is finite. The examples you gave of the heart and the Batman logo (also, think about the Donkey Kong one, Captain Falcon, Pikachu, Sonic, etc.) are certainly finite. When I read your question, my interpretation was like this: "I see something interesting like a heart, the Batman logo, something, something, etc.," where the "something" has to do with a real-life visualization (i.e., something that could be drawn with representational art). Does that make sense? – Daniel W. Farlow Sep 11 '15 at 15:17
• @ChrisJWelly Essentially, anything that you can draw (and therefore finite) can be plotted and graphed. That is what my answer and the other answers address. This answer is very neat and different though and points out some important things. +1 – Daniel W. Farlow Sep 11 '15 at 15:19

Yes. These graphs are often not functions, but can be written as several piecewise functions (which I imagine you have covered) with domain restrictions.

When I was a junior in high school, I graphed the words "Homecoming Date" and asked a girl to be my $f(x)$. I defined several functions as $f(x)$ to ensure that my wording was acceptable. She didn't seem to notice and accepted, haha.

But yes, your graphing possibilities are endless. Try some out yourself!

• But $f(x)$ is just a number ;) – ClassicStyle Sep 11 '15 at 3:50
• @TylerHG $f(x)$ need not be a number, it can mean a Korean girl band. – achille hui Sep 11 '15 at 5:53
• @achillehui, I almost always mean that, haha :)) – Fardad Pouran Sep 16 '15 at 5:55

The answer to your question is yes, you can plot any graph like the one you're interested in. A way to do this (which I'm sure won't be completely satisfying) is to simply have the complete list of all co-ordinate points that you want to graph, and define your mapping m so that $m(x) = y$ whenever $(x,y)$ is a co-ordinate point. (Also note here that $x$ might map to more than one $y$ - for example in your heart shaped example).

What it seems like you'd like however is a 'nice looking' map like $y = e^x-4x+1$, or something like that. In order to do something like this, many methods exist. I would suggest looking up interpolation for a start.

It would be a good idea to make clear what a graph is.

First, a function is simply an “answering machine” where you put something in, and get something else out. It's not necessarily something you could write as a mathematical formula in the usual way.
Only, it so happens that this is possible for many useful functions which simply map numbers to numbers – but that's just a very specific special case. For instance, a function could map manifolds to manifolds: it could map a sphere to a torus, a torus to a double torus, etc.. Or, perhaps an even better example would be the function that maps people to their parents.
To define a function you only need to define, for each input argument, what the result should be.

In particular, given any shape, you can define a function that takes an x-coordinate and yields the highest corresponding y-coordinate which is present in the shape. The graph of this function is then, again by definition, the upper edge of your original shape.

It's relatively easy to generalise this to give not only the upper edge but a whole drawing: if you can draw the shape with a pen, then this defines a function from time $t$ to position-of-the-pen-tip $p$. This can be used for a parametric plot, and by the implicit function theorem that is equivalent to a couple of graphs.

So, the answer to your question is trivially yes, because drawing is nothing else but plotting a function.

What's a more interesting question is whether any shape can be the plot of a function that's reasonably simple to write down / store as a definition. Daniel W. Farlow gave an example for how the usual maths-formula way is not really well-suited for this in general; however there are more optimised ways to do it. In particular, computer graphics file formats are essentially nothing but clever conventions of how to efficiently write (in binary form) a mathematical description of a picture/shape. Some such formats, the vector graphics kind, can actually give an exact description of shapes, however for more complicated stuff like photographs an exact description is not feasible; instead you approximate the image by something that looks almost the same. And finding such approximations is a pretty interesting topic mathematically, mainly in the branch of functional analysis.

That would actually be a partial function, because not for all $x$ can any point in the shape at all be found.

In fact its not possible, physically: a picture is a collection of measured brightnesses. No physical measurement is exact, it always has some uncertainty.

• Thank you! Your response is very insightful. – ChrisJWelly Sep 10 '15 at 11:53