Re: [Matplotlib-users] [matplotlib-devel] ANN: mpltools 0.1 release

2012-07-17 Thread todd rme
On Wed, Jul 11, 2012 at 5:23 PM, John Hunter jdh2...@gmail.com wrote:


 On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall
 damon.mcdoug...@gmail.com wrote:

 Well, as Ben said, that error fill plot is neato! It doesn't look too
 complicated, either. I'd be more than happy to port it over later today
 when I get bored of typing up my thesis. It'll probably only take me
 about 30 minutes.

 If nobody is opposed to this idea, I'll go ahead and submit a PR this
 evening (British Summer (hah!) Time).



 While it is a nice graph, I am not sure that the use case is common enough
 to justify a new plotting method.  One can get the same result with:


   In [68]: x = np.linspace(0, 2 * np.pi)

   In [69]: y_sin = np.sin(x)

   In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2])

   In [71]: plot(x, y_sin)
   Out[71]: [matplotlib.lines.Line2D object at 0x96959ec]

   In [72]: fill_between(np.concatenate([x, x[::-1]]), err, facecolor='red',
 alpha=0.5)
   Out[72]: matplotlib.collections.PolyCollection object at 0x962758c

 Admittedly the [::-1] thing is a bit counter-intuitive, but rather than
 adding a new plotting method, perhaps we would be better off with a helper
 method to create the xs and ys for fill_between

   xs, ys = mlab.pad_line(x, y, 0.2)
   fill_between(xs, ys)

 JDH

What about adding a property to the existing errorbar to let someone
change it to the filled version?  This could also, potentially, be
extended with other types of error bars if the need arises.

-Todd

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] ANN: mpltools 0.1 release

2012-07-17 Thread Benjamin Root
On Tue, Jul 17, 2012 at 6:25 AM, todd rme toddrme2...@gmail.com wrote:

 On Wed, Jul 11, 2012 at 5:23 PM, John Hunter jdh2...@gmail.com wrote:
 
 
  On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall
  damon.mcdoug...@gmail.com wrote:
 
  Well, as Ben said, that error fill plot is neato! It doesn't look too
  complicated, either. I'd be more than happy to port it over later today
  when I get bored of typing up my thesis. It'll probably only take me
  about 30 minutes.
 
  If nobody is opposed to this idea, I'll go ahead and submit a PR this
  evening (British Summer (hah!) Time).
 
 
 
  While it is a nice graph, I am not sure that the use case is common
 enough
  to justify a new plotting method.  One can get the same result with:
 
 
In [68]: x = np.linspace(0, 2 * np.pi)
 
In [69]: y_sin = np.sin(x)
 
In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2])
 
In [71]: plot(x, y_sin)
Out[71]: [matplotlib.lines.Line2D object at 0x96959ec]
 
In [72]: fill_between(np.concatenate([x, x[::-1]]), err,
 facecolor='red',
  alpha=0.5)
Out[72]: matplotlib.collections.PolyCollection object at 0x962758c
 
  Admittedly the [::-1] thing is a bit counter-intuitive, but rather than
  adding a new plotting method, perhaps we would be better off with a
 helper
  method to create the xs and ys for fill_between
 
xs, ys = mlab.pad_line(x, y, 0.2)
fill_between(xs, ys)
 
  JDH

 What about adding a property to the existing errorbar to let someone
 change it to the filled version?  This could also, potentially, be
 extended with other types of error bars if the need arises.

 -Todd


Intriguing idea.  I am actually quite comfortable with that.

Ben Root
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] ANN: mpltools 0.1 release

2012-07-17 Thread Damon McDougall
On Tue, Jul 17, 2012 at 08:21:50AM -0500, Benjamin Root wrote:
 On Tue, Jul 17, 2012 at 6:25 AM, todd rme toddrme2...@gmail.com wrote:
 
  On Wed, Jul 11, 2012 at 5:23 PM, John Hunter jdh2...@gmail.com wrote:
  
  
   On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall
   damon.mcdoug...@gmail.com wrote:
  
   Well, as Ben said, that error fill plot is neato! It doesn't look too
   complicated, either. I'd be more than happy to port it over later today
   when I get bored of typing up my thesis. It'll probably only take me
   about 30 minutes.
  
   If nobody is opposed to this idea, I'll go ahead and submit a PR this
   evening (British Summer (hah!) Time).
  
  
  
   While it is a nice graph, I am not sure that the use case is common
  enough
   to justify a new plotting method.  One can get the same result with:
  
  
 In [68]: x = np.linspace(0, 2 * np.pi)
  
 In [69]: y_sin = np.sin(x)
  
 In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2])
  
 In [71]: plot(x, y_sin)
 Out[71]: [matplotlib.lines.Line2D object at 0x96959ec]
  
 In [72]: fill_between(np.concatenate([x, x[::-1]]), err,
  facecolor='red',
   alpha=0.5)
 Out[72]: matplotlib.collections.PolyCollection object at 0x962758c
  
   Admittedly the [::-1] thing is a bit counter-intuitive, but rather than
   adding a new plotting method, perhaps we would be better off with a
  helper
   method to create the xs and ys for fill_between
  
 xs, ys = mlab.pad_line(x, y, 0.2)
 fill_between(xs, ys)
  
   JDH
 
  What about adding a property to the existing errorbar to let someone
  change it to the filled version?  This could also, potentially, be
  extended with other types of error bars if the need arises.
 
  -Todd
 
 
 Intriguing idea.  I am actually quite comfortable with that.
 

I like this idea, too.

 Ben Root

-- 
Damon McDougall
http://damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users