Re: [Matplotlib-users] Runtime error with matplotlib in IDLE

2012-03-12 Thread Catherine Thwaites
On Sun, Mar 11, 2012 at 11:27 PM, gsal salger...@gmail.com wrote:


 Don't have a solution; I was just wondering if you have tried something
 else,
 like using ipython instead of IDLE.  ipython may be better suited for
 threading and working with pylab, etc.


Thanks for the reply. I do like ipython might try the gui version.
--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Runtime error with matplotlib in IDLE

2012-03-10 Thread Catherine Thwaites
I have an error when running my script using matplotlib using IDLE. I
suspect it is something to do with either numpy or matplotlib and I was
wondering if any other users have had a similar problem. I have recently
installed Python, matplotlib and numpy, I have not had it working correctly
using IDLE on this machine. The error message is:

Runtime Error!

Program: C:\Python27\pythonw.exe

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's supporter team for more information.

The window header says Microsoft Visual C++ Runtime Library (which seems to
be about debugging). The error occurs about 50% of the time. When I run my
script in the command line it runs fine everytime. I am using matplotlib
and generating a pdf. If I remove the pdf generation step I still get the
error. But running another script (on the csv module) don't seem to
generate the error. I have searched on the internet without luck
(suggestion of installing visual studio which I have got) or posting to the
scipy list (well Im not using scipy).

I am using Win7 32 bit and matplotlib 1.1 and numpy 1.6.1 and python 2.7.
Has anyone else had similar message?

Catherine
--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plot linestyle as an arrow

2011-03-23 Thread Catherine Thwaites
Thanks for your help, I simplified what I was doing and so changed the data,
which is my fault. Here is some data of similar size to the data I am
plotting:
data1 = np.array([22000, 25000, 27000, 32000, 25000])
data2 = np.array([1400, 2200, 350, 300, 270])

When I try to run this with the above code I get a very strange graph and
these errors:


 In [16]: run t.py
 Warning: overflow encountered in long_scalars
 Warning: overflow encountered in long_scalars
 Warning: overflow encountered in long_scalars
 Warning: overflow encountered in long_scalars
 Warning: invalid value encountered in sqrt


So then tried the same method using the annotation as suggested (code below)
which worked perfectly.

import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.ticker import FuncFormatter

labels=('91','92','93','94','95')

data1 = np.array([22000, 25000, 27000, 32000, 25000])
data2 = np.array([1400, 2200, 350, 300, 270])

fig = plt.figure()
ax = fig.add_subplot(111)
# the next line is only use to set the proper lims,
p = ax.plot(data1, data2, 'bo', linestyle='-', markersize=3, alpha=0)
for x,y,dx,dy in zip(data1[:-1], data2[:-1], data1[1:], data2[1:]):
   ax.annotate('', xy=(dx,dy),  xycoords='data',
xytext=(x,y), textcoords='data',
arrowprops=dict(arrowstyle=-))

ax.set_xlim(21000,33000)

for i, label in enumerate(labels):
   x_loc = data1[i]
   y_loc = data2[i]
   txt = ax.annotate(label, xy=(x_loc, y_loc), size=8,
   xytext=(-10, 10), textcoords='offset points',
   arrowprops=None)

plt.show()

Just in case someone else has a similar problem.

Thanks
Catherine
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Plot linestyle as an arrow

2011-03-22 Thread Catherine Thwaites
I have tried to search for the answer but have not found anything useful so
forgive me if this has been answered before.
I want to change the linestyle of a regular plot to an arrow, in the
direction of the data in the tuple. So in this script below I would like an
arrow head pointing to the next marker.
There does not seem to be a line style to do it, but is there a way I can
add the head at the correct end of the line?

import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl

labels=('91','92','93','94','95')
data1 = (2500, 3000, 3500, 3000, 2700)
data2 = (200, 250, 270, 320, 250)

fig = plt.figure()
ax = fig.add_subplot(111)
p = ax.plot(data1, data2, 'bo', linestyle='-', markersize=3)
ax.set_ylim(0, 350)

for i, label in enumerate(labels):
x_loc = data1[i]
y_loc = data2[i]
txt = ax.annotate(label, xy=(x_loc, y_loc), size=8,
xytext=(-10, 10), textcoords='offset points',
arrowprops=None)

plt.show()

Catherine
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users