Matplotlib Contour Plots

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Aug 18 20:10:10 EDT 2014


Jamie Mitchell wrote:

> I forgot to mention that when I try:
> 
> a=np.array([[hs_con_sw],[te_con_sw]])
> 
> I get a 3D shape for some reason - (2,1,150) which is not what I'm after.

No need to wrap the arrays hs_con_sw and te_con_sw in [] lists, since
they're already arrays.

a = np.array([hs_con_sw, te_con_sw])

ought to do what you want. That's a list [] of arrays, hence
two-dimensional.



-- 
Steven




More information about the Python-list mailing list