hi chris,<br><br>i am using matplotlib for plotting graph, as following:<div class="im"><br><br>"import matplotlib.pyplot as plt"<br><br></div>can you kindly tell me how to fix this problem(crashing) ?<br><br><div class="gmail_quote">
On Thu, Oct 15, 2009 at 3:36 PM, Chris Rebert <span dir="ltr"><<a href="mailto:clp2@rebertia.com">clp2@rebertia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thu, Oct 15, 2009 at 2:14 AM, ankita dutta <<a href="mailto:ankita.dutta09@gmail.com">ankita.dutta09@gmail.com</a>> wrote:<br>
</div><div><div></div><div class="h5">> hi,<br>
> i am relatively new to python programming,<br>
> i am facing the following problem:<br>
><br>
> i am tring to simply obtain data from a file ( "B.txt" , data in this file<br>
> are in single column and floats)<br>
> and plot a graph between those values and thier index. ( for example if in<br>
> file , if at 2nd position valuse is 9.34 , x=9.34 and y=1).<br>
> .<br>
> .<br>
> .<br>
> ln1=open("B.txt","r+")<br>
> lines5=ln1.readlines()<br>
> exp=[ ]<br>
> c1=[ ]<br>
> for i in range (0,len(lines1)):<br>
> f1=lines1[i].split()<br>
> c1.append(float(f1[0]))<br>
> exp.append(i)<br>
> c1.sort(reverse=1)<br>
><br>
> lines=plt.plot(c1,exp,'ro')<br>
> plt.show()<br>
> .<br>
> .<br>
> .<br>
><br>
> but every time its showing the following error:<br>
><br>
> <some random value> is dumped<br>
> segmentation fault<br>
<br>
</div></div>The problem lies with whatever library you're using that provides<br>
"plt" (or is named "plt"; your code sample is incomplete). It's coded<br>
in C and is apparently crashing.<br>
<br>
Cheers,<br>
Chris<br>
<font color="#888888">--<br>
<a href="http://blog.rebertia.com" target="_blank">http://blog.rebertia.com</a><br>
</font></blockquote></div><br>