Plotting 3-tuple data points in a surface / contour plot using matplotlib
Posted
by morpheous
on Stack Overflow
See other posts from Stack Overflow
or by morpheous
Published on 2010-06-10T08:27:45Z
Indexed on
2010/06/10
8:32 UTC
Read the original article
Hit count: 389
I have some surface data that is generated by an external program as XYZ values. I want to create the following graphs, using matplotlib:
- Surface plot
- Contour plot
- Contour plot overlayed with a surface plot
I have looked at several examples for plotting surfaces and contours in matplotlib - however, the Z values seems to be a function of X and Y i.e. Y ~ f(X,Y).
I assume that I will somehow need to transform my Y variables, but I have not seen any example yet, that shows how to do this.
So, my question is this: given a set of (X,Y,Z) points, how may I generate Surface and contour plots from that data?
BTW, just to clarify, I do NOT want to create scatter plots. Also although I mentioned matplotlib in the title, I am not averse to using rpy(2), if that will allow me to create these charts.
© Stack Overflow or respective owner