1

I'm trying to plot the function

g(w) = wCw + w

where C = [[2 1],[3 1]] and w is also a 2x2 matrix.

I'm not sure how I should plot this in Python. I thought I might do something with the meshgrid function or somehow make a 3D plot?? But honestly, I'm not sure.

Candice
  • 45
  • 4
  • You could take a look at [`matplotlib.pyplot.matshow()`](https://matplotlib.org/3.2.1/api/_as_gen/matplotlib.pyplot.matshow.html). – Erik André Apr 15 '20 at 08:10
  • A simple 3D plot won't do. The domain is two dimensional, and so is the target set, so you would need four dimensions. One solution is to use a 3D plot with color as the 4th dimension. This has been asked before: https://stackoverflow.com/questions/7855229/how-to-make-a-4d-plot-using-python-with-matplotlib – Arne Apr 15 '20 at 08:15
  • 1
    @Arne I see. Thank you! I think this will help. – Candice Apr 15 '20 at 16:55

0 Answers0