i have googled this question and found: surface plots in matplotlib but got incredibly confused applying it to my problem. I looked on matplotlib website too but it was tough to figure out the arguments.
I currently have a matrix U, where each row i is the value of a put option due to a certain stock price at time i . E.g. U[0,0] is the value of an option at time 0 when the stock price is 0. U[1,0] is the value of an option at time 1 when the stock price is 0. U[1,1] is the value of an option at time 1 when the stock price is the first nodal point.
I am wanting to have a 3d plot of this, i.e. showing the evolution of the option value against stock price through time.
X axis: Stock price Y axis: Option value Z axis: Time.
Could anyone help me please? Thanks, James