Illustrating a point from a function in p-dimensional space

Are there any ‘pre-built’ utilities for plotting/illustrating a point in p-dimensional space?

Specifically, the value returned by a function with p-parameters.

I’ve hand sketched an illustration of the point in terms of the partial derivatives of the function wrt to each parameter at the point of interest, and was hoping that someone has tackled the problem of generating such illustrations.

Example:

I am not sure I understand this plot fully, but can’t you just plot “slices” (along axes, or arbitrary vectors) of an \mathbb{R}^n \to \mathbb{R} function as multiple plots?

Yes, that is the usual approach.
I’ve found some students would often accept (understand would be too strong) a multivariate/parameter function illustration such as the above rather than a neat panel showing the same plots arranged under/next to each other.

I was hoping to stop making crude drawings and make something a little neater

This is a pretty customized illustration. I am sure that it can be put together in TikZ (and thus PGFPlotsX.jl), although I assume it is nontrivial amount of work — you are in the best position to decide how important this is for you, but it can be done.

Plotting has a more or less standardized visual language, and students may be better off just becoming familiar with that. No doubt custom illustrations can be nice and illuminating, but since they are very costly they are rarely done, and decoding the visual language of something one-off may not be worth the investment for the reader.

1 Like

Thanks, that’ll be a start.

Not in Julia (yet, I’ll see about adding it to Grassmann.jl), but would something like this work ?

https://enkimute.github.io/ganja.js/examples/coffeeshop.html#nzUWfYz0k

You can easily change the function there, and it will handle any number of arguments.

(update: made it interactive, you can drag the point in 5 dimensions, it gets projected on each of the five axi sticking out of p to find the coefficient for that dimension.).

(removed old image here - I’m only allowed to post 1)

(edit: I just realized you want slightly different behavior - dragging p to move the cross and project onto the x-axis of each of the graphs for the coordinate in that dimension - I’ll have a go at that in a bit)

==============

Update … I believe the current version (same link) is more what you had in mind. Pretty fun way of displaying high-d scalar fields !

3 Likes

Here’s how you can reproduce @enkimute example with

using Blink, Ganja
w = Window()
loadganja!(w)
loadexample!(w,"multi-graphs.js")

To further customize the plot, the ganja script could be changed using metaprogramming.

It would be fairly easy to change the function f used with some metaprogramming.

With the help of @enkimute I plan on creating some more plotting tools based on ganja.js

2 Likes