Re: [Matplotlib-users] Difference Between Scatter and Plot? (Zig-Zag)--Solution

2010-02-07 Thread Wayne Watson
(I see I forgot to post this solution to the list. I really have 
quickly developed a dislike for having to go to extra lengths to make 
sure this happens. Perhaps one of my difficulties is that some people 
respond directly to me, and my mail filter shuttles the message to my 
matplotlib folder instead of my inbox, so it looks like someone has sent 
their response to the list.)

Looking at your code suggests this is not what I want. The cumsum 
(summation) buffaloes me. I've just moved to Win7, and my PC is not yet 
ready for Python, so  I can't really grasp what you have.

 From what I've been able to determine from  a friend, who knows MatLab 
extremely well, this is not a difficult thing to  do in MatLab, and 
likely in MPL. The creation of the path across a canvas/figure is done 
with plot. It will draw the zig-zag starting with x0,y0. To show the 
path clearly there are several ways  to  proceed. I can color each point 
successively with R,G, and  B. The  first red point, maybe  with the 
help of an icon, says this is the start. Maybe a red circle. The next 
two points use a green and blue circle, probably of a  different size, 
or maybe a square. R,G,B is repeated along the path. Another choice is 
to define an arrow and orient it in the direction of the next segment. 
An appealing way to do all of this is to pause drawing the next segment. 
That way, the dynamics of the path are clearly seen.

On 2/5/2010 5:16 AM, Alan G Isaac wrote:
 On 2/5/2010 12:51 AM, Wayne Watson wrote:

   what I'm looking for is a way to draw a zig-zag path
   indicating a path taken by a particle

 Here is a 2d example:

 import numpy as np
 import matplotlib.pyplot as plt
 locs = np.random.random_sample((2,30))
 locs = np.random.random_sample((2,30)) - 0.5
 locs = np.cumsum(locs, axis=-1)
 x,y = locs
 plt.plot(x,y)

 hth,
 Alan Isaac


 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



-- 
My life in two words. Interrupted Projects. -- WTW (quote originator)

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Difference Between Scatter and Plot? (Zig-Zag)--Solution

2010-02-07 Thread Alan G Isaac
Wayne Watson wrote:
  The cumsum (summation) buffaloes me.

That is just to create some artificial data,
to illustrate.  If you have the coordinates
in a 2 by N array named `locs`, just use the
last 2 lines.  If you already have the
coordinates separated into arrays x and y,
just use the last line, i.e., plt.plot(x,y).
Is that what you want?

hth,
Alan

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Difference Between Scatter and Plot? (Zig-Zag)

2010-02-05 Thread Alan G Isaac
On 2/5/2010 12:51 AM, Wayne Watson wrote:
  what I'm looking for is a way to draw a zig-zag path
  indicating a path taken by a particle

Here is a 2d example:

  import numpy as np
  import matplotlib.pyplot as plt
  locs = np.random.random_sample((2,30))
  locs = np.random.random_sample((2,30)) - 0.5
  locs = np.cumsum(locs, axis=-1)
  x,y = locs
  plt.plot(x,y)

hth,
Alan Isaac


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Difference Between Scatter and Plot?

2010-02-04 Thread Wayne Watson
Is there a difference between the two (Subject).  Perhaps plot connects 
lines in the order of x? However, scatter does not connect any points?
-- 
My life in two words. Interrupted Projects. -- WTW (quote originator)

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Difference Between Scatter and Plot? (Zig-Zag)

2010-02-04 Thread Wayne Watson
Simply explained what I'm looking for is a way to draw a zig-zag path 
indicating a path taken by a particle. Maybe this is best done with some 
tools outside of the normal plot capabilities?

On 2/4/2010 9:02 PM, Wayne Watson wrote:
 Is there a difference between the two (Subject).  Perhaps plot connects
 lines in the order of x? However, scatter does not connect any points?


-- 
My life in two words. Interrupted Projects. -- WTW (quote originator)

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Difference Between Scatter and Plot? (Zig-Zag)

2010-02-04 Thread Eric Firing
Wayne Watson wrote:
 Simply explained what I'm looking for is a way to draw a zig-zag path 
 indicating a path taken by a particle. Maybe this is best done with some 
 tools outside of the normal plot capabilities?

Why doesn't plot handle this? What do you see as missing?

 
 On 2/4/2010 9:02 PM, Wayne Watson wrote:
 Is there a difference between the two (Subject).  Perhaps plot connects
 lines in the order of x? However, scatter does not connect any points?


Yes, plot connects points in the order in which they appear in the input 
sequence; scatter does not connect, and has additional capabilities for 
varying the symbol, size, and color.

Eric

 


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users