0

I am using contourf to plot 3 points. The x values are (.5, 1.25, 1.75) and the y values are (1,1,1).

I have my 3 z points to go along with this. So, I made:

xlist = [[.5],        [1.25],      [1.75]       ]  
ylist = [[1],         [1],         [1]          ] 
zlist = [[11.09856186][10.82105586][ 9.73936149]]

However, when I run this, I get the error:

zlist must be at least a 2x2 array.

Does this mean I must graph at least 4 points?

BenT
  • 3,172
  • 3
  • 18
  • 38
Evan
  • 1,892
  • 2
  • 19
  • 40
  • You cannot draw a contour with 3 points... even when doing it by hand. Maybe you want to desribe a bit more in detail what you want to do and how the plot is supposed to look like. – ImportanceOfBeingErnest Jun 23 '19 at 18:08
  • Hey thanks, okay so basically I have 3 points that I know the values of a function for and I want to recreate the contour map for that function as best I can using only those 3 points. – Evan Jun 23 '19 at 18:31
  • and what is the minimum number of points you need to draw a contour by hand? 4? – Evan Jun 23 '19 at 18:40
  • Ok, so by hand it would work, if all x and y are different from each other. You could do the same with matplotlib's `tricontour`, but for y all being the same number, no contour can be defined mathematically. (Or maybe one could define it in the sense of "contour points" instead of contour lines, but I suppose that is not what you want). – ImportanceOfBeingErnest Jun 23 '19 at 18:45
  • ahh okay that does make sense, so if the ys are defined at the same value, even if the xs are defined differently, you cannot make a contour plot? – Evan Jun 23 '19 at 19:15
  • Yes, that is correct. – ImportanceOfBeingErnest Jun 23 '19 at 19:25
  • I aligned the 3 lists, do you notice anything? The syntax used for x and y does not match z. zlist is missing the `,` between elements... So it is not a list per say, hence the error. – Nic3500 Jun 24 '19 at 02:07

0 Answers0