Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18020

Re: Plot seems weird

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'am,': 0.12; 'def': 0.13; '[[],': 0.16; 'obvious.': 0.16; 'this:': 0.16; 'wrote:': 0.18; 'interesting.': 0.18; 'ryan': 0.18; 'dec': 0.22; 'header:In-Reply- To:1': 0.22; 'runs': 0.23; 'function': 0.27; 'import': 0.27; 'code,': 0.27; 'fixed': 0.29; 'pm,': 0.29; 'fairly': 0.30; 'observe': 0.30; 'pretty': 0.32; 'header:User-Agent:1': 0.33; 'header:X-Complaints-To:1': 0.33; 'to:addr:python-list': 0.34; 'lie': 0.34; 'received:au': 0.36; 'but': 0.37; 'received:org': 0.38; 'should': 0.39; "it's": 0.40; 'to:addr:python.org': 0.40; 'your': 0.61; 'simple,': 0.64; '26,': 0.67; '04:08': 0.84; 'fault,': 0.84; 'received:110': 0.95
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Lie Ryan <lie.1296@gmail.com>
Subject Re: Plot seems weird
Date Tue, 27 Dec 2011 21:54:57 +1100
References <880a2ed3-1a3f-45e7-b439-e87289403fd9@t16g2000vba.googlegroups.com> <c1ae9905-da26-4513-a456-99941ac53036@dp8g2000vbb.googlegroups.com> <4f709686-4b07-4096-a87c-3e4bf8571c73@v13g2000yqc.googlegroups.com> <mailman.4099.1324891710.27778.python-list@python.org> <74f9b578-ab36-4962-a353-ec52fe5ba12e@cs7g2000vbb.googlegroups.com> <mailman.4104.1324925950.27778.python-list@python.org> <96ac870e-dffe-4556-aa3a-fab84333ceda@o9g2000vbc.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 110-175-240-90.static.tpgi.com.au
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0
In-Reply-To <96ac870e-dffe-4556-aa3a-fab84333ceda@o9g2000vbc.googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4131.1324983314.27778.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1324983314 news.xs4all.nl 6879 [2001:888:2000:d::a6]:51389
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18020

Show key headers only | View raw


On 12/27/2011 06:14 AM, Yigit Turgut wrote:
> On Dec 26, 8:58 pm, Lie Ryan<lie.1...@gmail.com>  wrote:
>> On 12/27/2011 04:08 AM, Yigit Turgut wrote:
>>
>> not your fault, I made a mistake when copy-pasteing the code, here's the
>> fixed code:
>>
>> from itertools import izip_longest
>> def to_square(data):
>>        sq_data = [[], []]
>>        for x,y, xn in izip_longest(data[0], data[1], data[0][1:]):
>>            sq_data[0].append(x)
>>            sq_data[1].append(y)
>>            sq_data[0].append(xn)
>>            sq_data[1].append(y)
>>        return numpy.array(sq_data, dtype=float)
>>
>> use it like this:
>>
>> t,y1 = to_square(numpy.genfromtxt(filename, unpack=True))
>> pyplot.plot(t,y1)
>> pyplot.show()
>
> Significant improvement on the plot, pretty interesting. It runs ok
> but I need to know how?! (:

it's pretty simple, actually; just observe the numbers before and after 
it's fixed by the function and it should be fairly obvious.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Plot seems weird Yigit Turgut <y.turgut@gmail.com> - 2011-12-25 07:33 -0800
  Re: Plot seems weird Rick Johnson <rantingrickjohnson@gmail.com> - 2011-12-25 09:06 -0800
    Re: Plot seems weird Yigit Turgut <y.turgut@gmail.com> - 2011-12-25 10:27 -0800
      Re: Plot seems weird Lie Ryan <lie.1296@gmail.com> - 2011-12-26 20:28 +1100
        Re: Plot seems weird Yigit Turgut <y.turgut@gmail.com> - 2011-12-26 09:08 -0800
          Re: Plot seems weird Lie Ryan <lie.1296@gmail.com> - 2011-12-27 05:58 +1100
            Re: Plot seems weird Yigit Turgut <y.turgut@gmail.com> - 2011-12-26 11:14 -0800
              Re: Plot seems weird Lie Ryan <lie.1296@gmail.com> - 2011-12-27 21:54 +1100

csiph-web