As long as the context is clear, any placement is valid.
Note however that it is a convention to put the independent variable on the horizontal axis, and the dependent on the vertical. Any departure from this should be explicitly noted for clarity.
You could even call the independent variable f, and note the function x is you want, and graph the function x(f)... it's just a notation, but you can see how thing could be played with, and how it could be made as obscure as one wishes... if that is what you want! :)
Details as why one uses f, g, h... for functions, x, y, z, w, u, v, ... as variables, a, b, c, ... as constants, are just conventions that became tradition over time.
Look into the story of why "x" is used for "unknown" for example, you'll see how the history of notation could be fun (or not, it depends on your curiosity).