If f is a function handle, consider using fsurf()
"is there a way to draw in more than 3D"
For more than 3D you need to encode a dimension as one of the attributes of what you draw. The available attributes are:
- color (for surfaces and images)
- marker size
- marker shape
- marker face color
- marker edge color
Using transparency together with color is risky. Transparency against a white background affects brightness (well, saturation perhaps technically), but if you are already encoding dimension through brightness then it can be difficult for someone to tell the difference between a transparency difference and a brightness difference.
My personal practice is:
- for three spatial dimensions and one data dimension, represent the data by color, with transparency set constant so that you can see objects "behind" the front ones
- otherwise, encode as x, y, z, marker face color, marker size
If you have more than 5 continuous dimensions then you probably cannot reasonably represent the data in a single graph.
I find altering marker edge color to be effectively unreadable.
If one of your dimensions is discrete with no more than about 6 cases, or can reasonably be made discrete, then it can be encoded through marker shape. marker shape is not typically perceived as continuous: you can encode difference through marker shape, but people are probably not going to understand value encoded through marker shape. You could code using the markers . v s p h (circle, triangle, square, pentagon, hexagon), but in my experience people will not be able to count sides and mentally resolve that as a spatial dimension.