Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Peter Pearson Newsgroups: comp.lang.python Subject: Re: 2d color-bar map plot Date: 17 Oct 2014 15:51:21 GMT Lines: 35 Message-ID: References: X-Trace: individual.net e0Tvyf8k8yd3EC5zRaWfJwkHSglpsdtnF5KbSlqB3b63Wfd9LR Cancel-Lock: sha1:CxplVAjtBV/Tktl3orUUbnxwLlU= User-Agent: slrn/pre1.0.0-18 (Linux) Xref: csiph.com comp.lang.python:79245 On Fri, 17 Oct 2014 14:28:13 +0800, Dhananjay wrote: [snip] > xs = ys = zs = [] > for line in fl1: > line = line.split() > xs.append(float(line[0])) > ys.append(float(line[1])) > zs.append(float(line[2])) > > print xs[0], ys[0], zs[0] The line "xs = ys = zs = []" is almost surely not what you want to do. It results in xs, ys, and zs all being the same object. Look: >>> xs = ys = zs = [] >>> xs.append(1) >>> print(ys) [1] >>> Since your xs, ys, and zs are all identical, some unfortunate part of the plotting package is trying in vain to find some thickness to the thing it's plotting, but it can't, because all the points you've given it lie on the x=y=z plane. (It's sad that it tries so heroically to give a detailed error message that turns out to be so obscure.) So spend a few more characters: xs = [] ys = [] zs = [] Then, on to the next problem. -- To email me, substitute nowhere->runbox, invalid->com.