Re: [Matplotlib-users] How matplotlib got me a job

2012-02-08 Thread Paul Ivanov
Patrick Marsh, on 2012-02-07 13:58,  wrote:
 As I continue to mature as a Python person, I want to give back
 explicitly to the community that's given so much to me. The problem
 is, I don't know how. I'm intimidated by the awesomeness of what I see
 being done around me that I don't even know where to begin. How does
 one even begin to learn how to understand the deep intricacies of MPL,
 Numpy, and Scipy so that I'd begin to develop a comfort level that
 would allow me to begin to actively contribute? I know pretty much
 everyone on these listservs, including myself, is busy. (I'm in the
 midst of a 30-day PhD General Exam, and probably shouldn't even be
 reading the listservs and/or typing this email! *wink*) But if there
 are those out there that are willing to take a little time and invest
 in me, and I'm sure there are others like me, I'd gladly become an
 active contributor instead of a lurker.

One simple, minimally intimidating way to contribute is by making
improvements to the documentation. Here's a relevant pitch I just
made on the IPython lists about how easy, yet valuable such
improvements can be.

http://mail.scipy.org/pipermail/ipython-user/2012-February/009428.html

Another would be to send the colleagues whom your helping here to
these lists, that way any effort you put in to help them has a
good chance of helping others, thanks to search engines and
archives.

Yet another would be to go through some the active issues on the
tracker and trying to make a test for them. 

Yet another still would be to test the various active pull
requests - and confirm that the fixes or new functionality they
provide actually work - look through patches and ask questions -
we have a lot PRs that get very few eyes or comments on them
(Last [academic] year, I consciously made an effort to be more
active on this list, and though I haven't pitched in as much
lately, perhaps the rest of this year I should focus my efforts
on incoming PRs)
 
 Anyways, I know this email is a tad on the long side, and a little off
 the original topic, so if you're still reading, thanks! This is
 something that's been weighing on me for a few months now, and I
 thought Ben's exultation of the benefits of the community might be a
 good time to open up.

I'm still rather enjoying this whole thread, thanks for opening
up. I got worried how relatively quiet it's been here for a few
months, and glad we're starting to buck that trend.

best,
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How matplotlib got me a job

2012-02-08 Thread Jason Grout
On 2/8/12 2:53 AM, Paul Ivanov wrote:
 Patrick Marsh, on 2012-02-07 13:58,  wrote:
 As I continue to mature as a Python person, I want to give back
 explicitly to the community that's given so much to me. The problem
 is, I don't know how. I'm intimidated by the awesomeness of what I see
 being done around me that I don't even know where to begin. How does
 one even begin to learn how to understand the deep intricacies of MPL,
 Numpy, and Scipy so that I'd begin to develop a comfort level that
 would allow me to begin to actively contribute? I know pretty much
 everyone on these listservs, including myself, is busy. (I'm in the
 midst of a 30-day PhD General Exam, and probably shouldn't even be
 reading the listservs and/or typing this email! *wink*) But if there
 are those out there that are willing to take a little time and invest
 in me, and I'm sure there are others like me, I'd gladly become an
 active contributor instead of a lurker.

 One simple, minimally intimidating way to contribute is by making
 improvements to the documentation. Here's a relevant pitch I just
 made on the IPython lists about how easy, yet valuable such
 improvements can be.

 http://mail.scipy.org/pipermail/ipython-user/2012-February/009428.html

 Another would be to send the colleagues whom your helping here to
 these lists, that way any effort you put in to help them has a
 good chance of helping others, thanks to search engines and
 archives.

 Yet another would be to go through some the active issues on the
 tracker and trying to make a test for them.

 Yet another still would be to test the various active pull
 requests - and confirm that the fixes or new functionality they
 provide actually work - look through patches and ask questions -
 we have a lot PRs that get very few eyes or comments on them
 (Last [academic] year, I consciously made an effort to be more
 active on this list, and though I haven't pitched in as much
 lately, perhaps the rest of this year I should focus my efforts
 on incoming PRs)


Another big way we've seen new people contribute to the Sage community 
is to answer questions on the ask.sagemath.org site.  Scipy has a 
similar ask.scipy.org site, but it seems relatively quiet.

Jason

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] add a single x tick label

2012-02-08 Thread David Craig
Hi, I have a plot of a time series and I would like to add a single 
extra tick mark and label to the plot in a different color to the 
already existing tick marks. Is this possible??
Thanks,
D

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Partial coloring of text in matplotlib

2012-02-08 Thread Jae-Joon Lee
What can be done with the current Matplotlib is to use the offset boxes.
Here is a modified version of a code snippet from

 
http://abitofpythonabitofastronomy.blogspot.com/2009/05/mpl-multicolor-text.html

Regards,

-JJ


from matplotlib.offsetbox import HPacker, TextArea, AnnotationBbox

f = figure(1)
ax = f.add_subplot(111)

txt1 = TextArea(A$^3$, textprops=dict(color=r, size=150))
txt2 = TextArea(gb, textprops=dict(color=k, size=150))

txt = HPacker(children=[txt1, txt2],
align=baseline,
pad=0, sep=0)

bbox =  AnnotationBbox(txt, xy=(0.5, 0.5),
   xycoords='data',
   frameon=False,
   box_alignment=(0.5, 0.5), # alignment center, center
   )

ax.add_artist(bbox)

show()





On Wed, Feb 8, 2012 at 7:44 AM, Yann Tambouret yannp...@bu.edu wrote:
 Along the lines of Mike's suggestion, I thought this could be done using
 Latex.


 I posted an answer on SO with an example of doing this, but it seems only to
 work with postscript backend. Other backends override the color with the mpl
 text color setting.

 Is there a way to prevent this override? For example don't try to use 'PS'
 backend, and look at hte figure interactively. It defaults to black.

 http://stackoverflow.com/a/9185143/717357

 -Yann




 On Tue, Feb 7, 2012 at 4:46 PM, Paul Ivanov pivanov...@gmail.com wrote:

 Benjamin Root, on 2012-02-07 13:46,  wrote:
  Also, how deep should this rabbit hole go?  I could imagine one could
  want
  this for title() and figtitle().  Maybe it would be best to implement
  this
  at the Text() constructor level?

 For this reason, I would discourage even implementing such
 functionality in the core of matplotlib. This functionality doesn't strike
 me
 as something that ought to be available everywhere by default - if someone
 needs it, they can implement it as follows:

 -
 import matplotlib.pyplot as plt
 from matplotlib import transforms

 def rainbow_text(x,y,ls,lc,**kw):
    
    Take a list of strings ``ls`` and colors ``lc`` and place them next to
 each
    other, with text ls[i] being shown in color lc[i].

    This example shows how to do both vertical and horizontal text, and
 will
    pass all keyword arguments to plt.text, so you can set the font size,
    family, etc.
    
    t = plt.gca().transData
    fig = plt.gcf()
    plt.show()

    #horizontal version
    for s,c in zip(ls,lc):
        text = plt.text(x,y, +s+ ,color=c, transform=t, **kw)
        text.draw(fig.canvas.get_renderer())
        ex = text.get_window_extent()
        t = transforms.offset_copy(text._transform, x=ex.width,
 units='dots')

    #vertical version
    for s,c in zip(ls,lc):
        text = plt.text(x,y, +s+ ,color=c, transform=t,
                rotation=90,va='bottom',ha='center',**kw)
        text.draw(fig.canvas.get_renderer())
        ex = text.get_window_extent()
        t = transforms.offset_copy(text._transform, y=ex.height,
 units='dots')


 plt.figure()
 rainbow_text(0.5,0.5,all unicorns poop rainbows ! ! !.split(),
        ['red', 'orange', 'brown', 'green', 'blue', 'purple', 'black'],
        size=40)

 best,
 --
 Paul Ivanov
 314 address only used for lists,  off-list direct email at:
 http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7


 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net

[Matplotlib-users] Strange plot_date problem

2012-02-08 Thread Ted To
Hi,

I'm experiencing a very strange problem with plot_date that I can't
figure out.

pyplot.plot_date(pylab.date2num(dates),diff,'b-',label='Chained')
pyplot.show()

dates, naturally, is a list of dates and diff is an array of floats.
With my script, this fails.  But if I interactively enter dates and diff
and then type the above commands, it works with no problems.  Any ideas
or suggestions?

The traceback follows.

Thanks,
Ted

Exception in Tkinter callback
Traceback (most recent call last):
  File /usr/lib/python2.6/lib-tk/Tkinter.py, line 1413, in __call__
return self.func(*args)
  File
/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py,
line 245, in resize
self.show()
  File
/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py,
line 248, in draw
FigureCanvasAgg.draw(self)
  File
/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py, line
394, in draw
self.figure.draw(self.renderer)
  File /usr/lib/pymodules/python2.6/matplotlib/artist.py, line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /usr/lib/pymodules/python2.6/matplotlib/figure.py, line 798, in
draw
func(*args)
  File /usr/lib/pymodules/python2.6/matplotlib/artist.py, line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /usr/lib/pymodules/python2.6/matplotlib/axes.py, line 1946, in draw
a.draw(renderer)
  File /usr/lib/pymodules/python2.6/matplotlib/artist.py, line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /usr/lib/pymodules/python2.6/matplotlib/axis.py, line 971, in draw
tick_tups = [ t for t in self.iter_ticks()]
  File /usr/lib/pymodules/python2.6/matplotlib/axis.py, line 904, in
iter_ticks
majorLocs = self.major.locator()
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 743, in
__call__
self.refresh()
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 752, in
refresh
dmin, dmax = self.viewlim_to_dt()
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 524, in
viewlim_to_dt
return num2date(vmin, self.tz), num2date(vmax, self.tz)
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 289, in
num2date
if not cbook.iterable(x): return _from_ordinalf(x, tz)
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 203, in
_from_ordinalf
dt = datetime.datetime.fromordinal(ix)
ValueError: ordinal must be = 1

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] add a single x tick label

2012-02-08 Thread John Hunter
On Wed, Feb 8, 2012 at 8:42 AM, David Craig dcdavem...@gmail.com wrote:

Hi, I have a plot of a time series and I would like to add a single
 extra tick mark and label to the plot in a different color to the
 already existing tick marks. Is this possible??
 Thanks,



It's fairly easy to do if you want to set the tick locations and labels
youself (see http://matplotlib.sourceforge.net/users/artists.html near the
end for an overview of the mpl containers like Tick and the attributes they
contain).

import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots(1)

ax.plot(np.random.randn(10,2)*10)

locs = np.arange(2, 10, 2)
labels = ['%d'%loc for loc in locs]
ticks, labels = plt.xticks(locs, labels)

i = 2
# tick1line and tick2line are matplotlib.lines.Line2D instances
ticks[i].tick1line.set_color('red')
ticks[i].tick2line.set_color('red')
labels[i].set_color('red')

plt.show()

If you want to add a tick using the existing mpl auto tick locating and
labeling infrastructure, it is also possible but you will need to subclass
the tick locator.



JDH
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Strange plot_date problem

2012-02-08 Thread Ted To
If it hasn't been fixed, is there a workaround?

On 02/08/2012 10:42 AM, Ted To wrote:
 I believe I have traced it to some axhline and axis commands and this is
 apparently an old problem.  Does it work with version 1.1.0?  I have
 1.0.1 installed on a debian system.
 
 On 02/08/2012 09:47 AM, Ted To wrote:
 Hi,

 I'm experiencing a very strange problem with plot_date that I can't
 figure out.

 pyplot.plot_date(pylab.date2num(dates),diff,'b-',label='Chained')
 pyplot.show()

 dates, naturally, is a list of dates and diff is an array of floats.
 With my script, this fails.  But if I interactively enter dates and diff
 and then type the above commands, it works with no problems.  Any ideas
 or suggestions?

 The traceback follows.

 Thanks,
 Ted

 Exception in Tkinter callback
 Traceback (most recent call last):
   File /usr/lib/python2.6/lib-tk/Tkinter.py, line 1413, in __call__
 return self.func(*args)
   File
 /usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py,
 line 245, in resize
 self.show()
   File
 /usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py,
 line 248, in draw
 FigureCanvasAgg.draw(self)
   File
 /usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py, line
 394, in draw
 self.figure.draw(self.renderer)
   File /usr/lib/pymodules/python2.6/matplotlib/artist.py, line 55, in
 draw_wrapper
 draw(artist, renderer, *args, **kwargs)
   File /usr/lib/pymodules/python2.6/matplotlib/figure.py, line 798, in
 draw
 func(*args)
   File /usr/lib/pymodules/python2.6/matplotlib/artist.py, line 55, in
 draw_wrapper
 draw(artist, renderer, *args, **kwargs)
   File /usr/lib/pymodules/python2.6/matplotlib/axes.py, line 1946, in draw
 a.draw(renderer)
   File /usr/lib/pymodules/python2.6/matplotlib/artist.py, line 55, in
 draw_wrapper
 draw(artist, renderer, *args, **kwargs)
   File /usr/lib/pymodules/python2.6/matplotlib/axis.py, line 971, in draw
 tick_tups = [ t for t in self.iter_ticks()]
   File /usr/lib/pymodules/python2.6/matplotlib/axis.py, line 904, in
 iter_ticks
 majorLocs = self.major.locator()
   File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 743, in
 __call__
 self.refresh()
   File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 752, in
 refresh
 dmin, dmax = self.viewlim_to_dt()
   File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 524, in
 viewlim_to_dt
 return num2date(vmin, self.tz), num2date(vmax, self.tz)
   File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 289, in
 num2date
 if not cbook.iterable(x): return _from_ordinalf(x, tz)
   File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 203, in
 _from_ordinalf
 dt = datetime.datetime.fromordinal(ix)
 ValueError: ordinal must be = 1

 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Strange plot_date problem

2012-02-08 Thread John Hunter
On Wed, Feb 8, 2012 at 10:06 AM, Ted To rainexpec...@theo.to wrote:

 If it hasn't been fixed, is there a workaround?

 On 02/08/2012 10:42 AM, Ted To wrote:
  I believe I have traced it to some axhline and axis commands and this is
  apparently an old problem.  Does it work with version 1.1.0?  I have
  1.0.1 installed on a debian system.


Can you print(dates) before calling plot in the environment in which it
fails and post the output here.

JDH
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Strange plot_date problem

2012-02-08 Thread Ted To
On 02/08/2012 11:17 AM, John Hunter wrote:
 
 
 On Wed, Feb 8, 2012 at 10:06 AM, Ted To rainexpec...@theo.to
 mailto:rainexpec...@theo.to wrote:
 
 If it hasn't been fixed, is there a workaround?
 
 On 02/08/2012 10:42 AM, Ted To wrote:
  I believe I have traced it to some axhline and axis commands and
 this is
  apparently an old problem.  Does it work with version 1.1.0?  I have
  1.0.1 installed on a debian system.
 
 
 Can you print(dates) before calling plot in the environment in which
 it fails and post the output here.
 
 JDH

Sure, the commands where it crashes and the output are:

print dates
pyplot.axis([0, len(prices.label[0]), -1.5, 1.5])
pyplot.axhline(-.5,color='r')
pyplot.axhline(.5,color='r')
pyplot.axhline(0,color='.75')
diff = (fisherChained-tornqvistChained)*100
pyplot.plot_date(pylab.date2num(dates),diff,'b-',label='Chained')
pyplot.setp(pyplot.gca().get_xmajorticklabels(),rotation=30)
pyplot.savefig(city+agg+'Diffs.pdf')


[datetime.date(1992, 12, 12), datetime.date(1992, 12, 19),
datetime.date(1992, 12, 26), datetime.date(1993, 1, 2),
datetime.date(1993, 1, 9), datetime.date(1993, 1, 16),
datetime.date(1993, 1, 23), datetime.date(1993, 1, 30),
datetime.date(1993, 2, 6), datetime.date(1993, 2, 13),
datetime.date(1993, 2, 20), datetime.date(1993, 2, 27),
datetime.date(1993, 3, 6), datetime.date(1993, 3, 13),
datetime.date(1993, 3, 20), datetime.date(1993, 3, 27),
datetime.date(1993, 4, 3), datetime.date(1993, 4, 10),
datetime.date(1993, 4, 17), datetime.date(1993, 4, 24),
datetime.date(1993, 5, 1), datetime.date(1993, 5, 8),
datetime.date(1993, 5, 15), datetime.date(1993, 5, 22),
datetime.date(1993, 5, 29), datetime.date(1993, 6, 5),
datetime.date(1993, 6, 12), datetime.date(1993, 6, 19),
datetime.date(1993, 6, 26), datetime.date(1993, 7, 3),
datetime.date(1993, 7, 10), datetime.date(1993, 7, 17),
datetime.date(1993, 7, 24), datetime.date(1993, 7, 31),
datetime.date(1993, 8, 7), datetime.date(1993, 8, 14),
datetime.date(1993, 8, 21), datetime.date(1993, 8, 28),
datetime.date(1993, 9, 4), datetime.date(1993, 9, 11),
datetime.date(1993, 9, 18), datetime.date(1993, 9, 25),
datetime.date(1993, 10, 2), datetime.date(1993, 10, 9),
datetime.date(1993, 10, 16), datetime.date(1993, 10, 23),
datetime.date(1993, 10, 30), datetime.date(1993, 11, 6),
datetime.date(1993, 11, 13), datetime.date(1993, 11, 20),
datetime.date(1993, 11, 27), datetime.date(1993, 12, 4),
datetime.date(1993, 12, 11), datetime.date(1993, 12, 18),
datetime.date(1993, 12, 25), datetime.date(1994, 1, 1),
datetime.date(1994, 1, 8), datetime.date(1994, 1, 15),
datetime.date(1994, 1, 22), datetime.date(1994, 1, 29),
datetime.date(1994, 2, 5), datetime.date(1994, 2, 12),
datetime.date(1994, 2, 19), datetime.date(1994, 2, 26),
datetime.date(1994, 3, 5), datetime.date(1994, 3, 12),
datetime.date(1994, 3, 19), datetime.date(1994, 3, 26),
datetime.date(1994, 4, 2), datetime.date(1994, 4, 9),
datetime.date(1994, 4, 16), datetime.date(1994, 4, 23),
datetime.date(1994, 4, 30), datetime.date(1994, 5, 7),
datetime.date(1994, 5, 14), datetime.date(1994, 5, 21),
datetime.date(1994, 5, 28), datetime.date(1994, 6, 4),
datetime.date(1994, 6, 11), datetime.date(1994, 6, 18),
datetime.date(1994, 6, 25), datetime.date(1994, 7, 2),
datetime.date(1994, 7, 9), datetime.date(1994, 7, 16),
datetime.date(1994, 7, 23), datetime.date(1994, 7, 30),
datetime.date(1994, 8, 6), datetime.date(1994, 8, 13),
datetime.date(1994, 8, 20), datetime.date(1994, 8, 27),
datetime.date(1994, 9, 3), datetime.date(1994, 9, 10),
datetime.date(1994, 9, 17), datetime.date(1994, 9, 24),
datetime.date(1994, 10, 1), datetime.date(1994, 10, 8),
datetime.date(1994, 10, 15), datetime.date(1994, 10, 22),
datetime.date(1994, 10, 29), datetime.date(1994, 11, 5),
datetime.date(1994, 11, 12), datetime.date(1994, 11, 19),
datetime.date(1994, 11, 26), datetime.date(1994, 12, 3),
datetime.date(1994, 12, 10), datetime.date(1994, 12, 17),
datetime.date(1994, 12, 24), datetime.date(1994, 12, 31)]
Traceback (most recent call last):
  File makeIndices.py, line 128, in module
pyplot.setp(pyplot.gca().get_xmajorticklabels(),rotation=30)
  File /usr/lib/pymodules/python2.6/matplotlib/axes.py, line 2440, in
get_xmajorticklabels
self.xaxis.get_majorticklabels())
  File /usr/lib/pymodules/python2.6/matplotlib/axis.py, line 1071, in
get_majorticklabels
ticks = self.get_major_ticks()
  File /usr/lib/pymodules/python2.6/matplotlib/axis.py, line 1169, in
get_major_ticks
numticks = len(self.get_major_locator()())
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 743, in
__call__
self.refresh()
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 752, in
refresh
dmin, dmax = self.viewlim_to_dt()
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 524, in
viewlim_to_dt
return num2date(vmin, self.tz), num2date(vmax, self.tz)
  File /usr/lib/pymodules/python2.6/matplotlib/dates.py, line 289, in
num2date
if not 

Re: [Matplotlib-users] Strange plot_date problem

2012-02-08 Thread John Hunter
On Wed, Feb 8, 2012 at 10:24 AM, Ted To rainexpec...@theo.to wrote:

 On 02/08/2012 11:17 AM, John Hunter wrote:
 
 
  On Wed, Feb 8, 2012 at 10:06 AM, Ted To rainexpec...@theo.to
  mailto:rainexpec...@theo.to wrote:
 
  If it hasn't been fixed, is there a workaround?
 
  On 02/08/2012 10:42 AM, Ted To wrote:
   I believe I have traced it to some axhline and axis commands and
  this is
   apparently an old problem.  Does it work with version 1.1.0?  I
 have
   1.0.1 installed on a debian system.
 
 
  Can you print(dates) before calling plot in the environment in which
  it fails and post the output here.
 
  JDH

 Sure, the commands where it crashes and the output are:

 print dates
 pyplot.axis([0, len(prices.label[0]), -1.5, 1.5])




OK, here is where the problem is.  In the plt.axis call you are setting the
x-axis min to 0 which is not a legal date value.  I suggest letting the
x-axis take care of itself, and set the y-axis limits with

plt.ylim(-1.5, 1.5)

JDH
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Partial coloring of text in matplotlib

2012-02-08 Thread Gökhan Sever
This is the solution which requires the least modification to the original
text inserting functions. The only drawback is like you said, it only works
with ps backend.

Any idea if this could be generalized for other backends?

On Tue, Feb 7, 2012 at 3:44 PM, Yann Tambouret yannp...@bu.edu wrote:

 Along the lines of Mike's suggestion, I thought this could be done using
 Latex.


 I posted an answer on SO with an example of doing this, but it seems only
 to work with postscript backend. Other backends override the color with the
 mpl text color setting.

 Is there a way to prevent this override? For example don't try to use 'PS'
 backend, and look at hte figure interactively. It defaults to black.

 http://stackoverflow.com/a/9185143/717357

 -Yann




 On Tue, Feb 7, 2012 at 4:46 PM, Paul Ivanov pivanov...@gmail.com wrote:

 Benjamin Root, on 2012-02-07 13:46,  wrote:
  Also, how deep should this rabbit hole go?  I could imagine one could
 want
  this for title() and figtitle().  Maybe it would be best to implement
 this
  at the Text() constructor level?

 For this reason, I would discourage even implementing such
 functionality in the core of matplotlib. This functionality doesn't
 strike me
 as something that ought to be available everywhere by default - if someone
 needs it, they can implement it as follows:

 -
 import matplotlib.pyplot as plt
 from matplotlib import transforms

 def rainbow_text(x,y,ls,lc,**kw):

Take a list of strings ``ls`` and colors ``lc`` and place them next to
 each
other, with text ls[i] being shown in color lc[i].

This example shows how to do both vertical and horizontal text, and
 will
pass all keyword arguments to plt.text, so you can set the font size,
family, etc.

t = plt.gca().transData
fig = plt.gcf()
plt.show()

#horizontal version
for s,c in zip(ls,lc):
text = plt.text(x,y, +s+ ,color=c, transform=t, **kw)
text.draw(fig.canvas.get_renderer())
ex = text.get_window_extent()
t = transforms.offset_copy(text._transform, x=ex.width,
 units='dots')

#vertical version
for s,c in zip(ls,lc):
text = plt.text(x,y, +s+ ,color=c, transform=t,
rotation=90,va='bottom',ha='center',**kw)
text.draw(fig.canvas.get_renderer())
ex = text.get_window_extent()
t = transforms.offset_copy(text._transform, y=ex.height,
 units='dots')


 plt.figure()
 rainbow_text(0.5,0.5,all unicorns poop rainbows ! ! !.split(),
['red', 'orange', 'brown', 'green', 'blue', 'purple', 'black'],
size=40)

 best,
 --
 Paul Ivanov
 314 address only used for lists,  off-list direct email at:
 http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7


 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Gökhan
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
I was trying to test the patch mike put in to fix the single pixel
plotting issue, but just realized that this was a Mac version.  Can I
use it on a linux box? How?

Thanks,
Chris

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread John Hunter
On Wed, Feb 8, 2012 at 11:06 AM, Chris plut...@gmail.com wrote:

 I was trying to test the patch mike put in to fix the single pixel
 plotting issue, but just realized that this was a Mac version.  Can I
 use it on a linux box? How?


These instructions are for an ubuntu based system -- if you are on a
different version of linux you may need different commands to install git
and the mpl build dependencies

# install git to checkout the mpl src code
sudo apt-get install git

# install the pre-reqs to build matplotlib from source
sudo apt-get build-dep python-matplotlib

# get the latest released branch of matplotlib
git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

# cd into the matplotlib directory and create a branch off of the release
branch to test
cd matplotlib.git
git checkout -b mdboom-pixel_marker v1.1.x

# pull in Michael's changes
git pull https://github.com/mdboom/matplotlib.git pixel_marker

# build the matplotlib source code
python setup.py build

# install it
sudo python setup.py install
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
Thanks John.  Since I already have a running copy of mpl, I skipped to
the git clone step, but get this error:

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

I'm a complete noob on git, so please bear with me.

- Chris

On Wed, Feb 8, 2012 at 9:31 AM, John Hunter jdh2...@gmail.com wrote:


 On Wed, Feb 8, 2012 at 11:06 AM, Chris plut...@gmail.com wrote:

 I was trying to test the patch mike put in to fix the single pixel
 plotting issue, but just realized that this was a Mac version.  Can I
 use it on a linux box? How?


 These instructions are for an ubuntu based system -- if you are on a
 different version of linux you may need different commands to install git
 and the mpl build dependencies

 # install git to checkout the mpl src code
 sudo apt-get install git

 # install the pre-reqs to build matplotlib from source
 sudo apt-get build-dep python-matplotlib

 # get the latest released branch of matplotlib
 git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

 # cd into the matplotlib directory and create a branch off of the release
 branch to test
 cd matplotlib.git
 git checkout -b mdboom-pixel_marker v1.1.x

 # pull in Michael's changes
 git pull https://github.com/mdboom/matplotlib.git pixel_marker

 # build the matplotlib source code
 python setup.py build

 # install it
 sudo python setup.py install

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread John Hunter
On Wed, Feb 8, 2012 at 11:39 AM, Chris plut...@gmail.com wrote:

 Thanks John.  Since I already have a running copy of mpl, I skipped to
 the git clone step, but get this error:

 Permission denied (publickey).
 fatal: The remote end hung up unexpectedly

 I'm a complete noob on git, so please bear with me.



I think I should have pointed you to the read only address.  Try this:


 git pull git://github.com/mdboom/matplotlib.git pixel_marker

JDH
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
This time the error is:

fatal: Not a git repository (or any of the parent directories): .git

I guess that I have not be able to establish a local git tree since the command

git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

did not go through.

- Chris

On Wed, Feb 8, 2012 at 9:48 AM, John Hunter jdh2...@gmail.com wrote:


 On Wed, Feb 8, 2012 at 11:39 AM, Chris plut...@gmail.com wrote:

 Thanks John.  Since I already have a running copy of mpl, I skipped to
 the git clone step, but get this error:

 Permission denied (publickey).
 fatal: The remote end hung up unexpectedly

 I'm a complete noob on git, so please bear with me.



 I think I should have pointed you to the read only address.  Try this:


  git pull git://github.com/mdboom/matplotlib.git pixel_marker

 JDH


--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Tony Yu
On Wed, Feb 8, 2012 at 12:58 PM, Chris plut...@gmail.com wrote:

 This time the error is:

 fatal: Not a git repository (or any of the parent directories): .git

 I guess that I have not be able to establish a local git tree since the
 command

 git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

 did not go through.

 - Chris


I don't think you want the .git at the very end of the clone command.
That just tells get where (i.e. new directory) to put the repo.

-Tony


 On Wed, Feb 8, 2012 at 9:48 AM, John Hunter jdh2...@gmail.com wrote:
 
 
  On Wed, Feb 8, 2012 at 11:39 AM, Chris plut...@gmail.com wrote:
 
  Thanks John.  Since I already have a running copy of mpl, I skipped to
  the git clone step, but get this error:
 
  Permission denied (publickey).
  fatal: The remote end hung up unexpectedly
 
  I'm a complete noob on git, so please bear with me.
 
 
 
  I think I should have pointed you to the read only address.  Try this:
 
 
   git pull git://github.com/mdboom/matplotlib.git pixel_marker
 
  JDH
 


 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread John Hunter
On Wed, Feb 8, 2012 at 11:58 AM, Chris plut...@gmail.com wrote:

 This time the error is:

 fatal: Not a git repository (or any of the parent directories): .git

 I guess that I have not be able to establish a local git tree since the
 command

 git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

 did not go through.


I see, that is also the ssh version.  Here is the http read only version.
 Updated my complete instructions:

# install git to checkout the mpl src code
sudo apt-get install git

# install the pre-reqs to build matplotlib from source
sudo apt-get build-dep python-matplotlib

# get the latest released branch of matplotlib
git clone git://github.com/matplotlib/matplotlib.git matplotlib.git

# cd into the matplotlib directory and create a branch off of the release
branch to test
cd matplotlib.git
git checkout -b mdboom-pixel_marker v1.1.x

# pull in Michael's changes
git pull git://github.com/mdboom/matplotlib.git pixel_marker

# build the matplotlib source code
python setup.py build

# install it
sudo python setup.py install
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread John Hunter
On Wed, Feb 8, 2012 at 12:06 PM, Tony Yu tsy...@gmail.com wrote:

 git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

 did not go through.

 - Chris


 I don't think you want the .git at the very end of the clone command.
 That just tells get where (i.e. new directory) to put the repo.


I don't think that is the problem.  I just add the .git extension because
the default is to check out a directory called matplotlib which if it is
located in the path you are running or testing from, will confuse the
import.  So I just add some extension so python won't confuse the mpl src
dir (matplotlib.git) with the mpl package (matplotlib).
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
New error at `git checkout -b mdboom-pixel_marker v1.1.x':

fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'v1.1.x' which can not be resolved as commit?

- Chris

On Wed, Feb 8, 2012 at 10:13 AM, John Hunter jdh2...@gmail.com wrote:


 On Wed, Feb 8, 2012 at 12:06 PM, Tony Yu tsy...@gmail.com wrote:

 git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

 did not go through.

 - Chris


 I don't think you want the .git at the very end of the clone command.
 That just tells get where (i.e. new directory) to put the repo.


 I don't think that is the problem.  I just add the .git extension because
 the default is to check out a directory called matplotlib which if it is
 located in the path you are running or testing from, will confuse the
 import.  So I just add some extension so python won't confuse the mpl src
 dir (matplotlib.git) with the mpl package (matplotlib).

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Dale Chayes
I interpreted the public key error (as did others) to be an ssh issue.  For a 
publicly readable approach this seems to work:

[dhcp-90-166:python/matplotlib/git] dale% git clone 
git://github.com/matplotlib/matplotlib.git
Cloning into matplotlib...
remote: Counting objects: 57725, done.
remote: Compressing objects: 100% (13597/13597), done.
remote: Total 57725 (delta 44284), reused 57317 (delta 43924)
Receiving objects: 100% (57725/57725), 81.69 MiB | 2.67 MiB/s, done.
Resolving deltas: 100% (44284/44284), done.
[dhcp-90-166:python/matplotlib/git] dale% ll
total 0
drwxr-xr-x   3 dale  staff   102 Feb  8 13:20 .
drwxr-xr-x   5 dale  staff   170 Feb  8 13:08 ..
drwxr-xr-x  33 dale  staff  1122 Feb  8 13:21 matplotlib
[dhcp-90-166:python/matplotlib/git] dale% 

-Dale



On Feb 8, 2012, at 13:13 , John Hunter wrote:

 
 
 On Wed, Feb 8, 2012 at 12:06 PM, Tony Yu tsy...@gmail.com wrote:
 
 git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git
 
 did not go through.
 
 - Chris
 
 
 I don't think you want the .git at the very end of the clone command. That 
 just tells get where (i.e. new directory) to put the repo.
 
 
 I don't think that is the problem.  I just add the .git extension because the 
 default is to check out a directory called matplotlib which if it is 
 located in the path you are running or testing from, will confuse the import. 
  So I just add some extension so python won't confuse the mpl src dir 
 (matplotlib.git) with the mpl package (matplotlib).
 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Tony Yu
On Wed, Feb 8, 2012 at 1:20 PM, Chris plut...@gmail.com wrote:

 New error at `git checkout -b mdboom-pixel_marker v1.1.x':

 fatal: git checkout: updating paths is incompatible with switching
 branches.
 Did you intend to checkout 'v1.1.x' which can not be resolved as commit?

 - Chris


That looks like something I've done before without issue. Maybe you're on
an older version of git. In any case, you can break this up into two steps

# change to maintenance branch
git checkout v1.1.x

# create new branch based on current checkout
git checkout -b mdboom-pixel_marker


Then continue as John instructed.

-Tony





 On Wed, Feb 8, 2012 at 10:13 AM, John Hunter jdh2...@gmail.com wrote:
 
 
  On Wed, Feb 8, 2012 at 12:06 PM, Tony Yu tsy...@gmail.com wrote:
 
  git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git
 
  did not go through.
 
  - Chris
 
 
  I don't think you want the .git at the very end of the clone command.
  That just tells get where (i.e. new directory) to put the repo.
 
 
  I don't think that is the problem.  I just add the .git extension because
  the default is to check out a directory called matplotlib which if it
 is
  located in the path you are running or testing from, will confuse the
  import.  So I just add some extension so python won't confuse the mpl src
  dir (matplotlib.git) with the mpl package (matplotlib).

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
Thanks Tony and JDH, problem resolved and now I can try to compile.

- Chris

On Wed, Feb 8, 2012 at 10:41 AM, Tony Yu tsy...@gmail.com wrote:


 On Wed, Feb 8, 2012 at 1:20 PM, Chris plut...@gmail.com wrote:

 New error at `git checkout -b mdboom-pixel_marker v1.1.x':

 fatal: git checkout: updating paths is incompatible with switching
 branches.
 Did you intend to checkout 'v1.1.x' which can not be resolved as commit?

 - Chris


 That looks like something I've done before without issue. Maybe you're on an
 older version of git. In any case, you can break this up into two steps

 # change to maintenance branch
 git checkout v1.1.x

 # create new branch based on current checkout
 git checkout -b mdboom-pixel_marker


 Then continue as John instructed.

 -Tony





 On Wed, Feb 8, 2012 at 10:13 AM, John Hunter jdh2...@gmail.com wrote:
 
 
  On Wed, Feb 8, 2012 at 12:06 PM, Tony Yu tsy...@gmail.com wrote:
 
  git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git
 
  did not go through.
 
  - Chris
 
 
  I don't think you want the .git at the very end of the clone command.
  That just tells get where (i.e. new directory) to put the repo.
 
 
  I don't think that is the problem.  I just add the .git extension
  because
  the default is to check out a directory called matplotlib which if it
  is
  located in the path you are running or testing from, will confuse the
  import.  So I just add some extension so python won't confuse the mpl
  src
  dir (matplotlib.git) with the mpl package (matplotlib).



--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plot_date again

2012-02-08 Thread Ted To
Hi,

Is it possible to force the date ticks to be the same in two different
plots?  For example, the attached figures cover the same time spans but
in one, the data are weekly and the other, monthly.  While there is
nothing really wrong with different tick marks, aesthetically it would
be nice if they were both the same.

Thanks,
Ted


chicagoMonthStoreUPCChainedIndices.pdf
Description: Adobe PDF document


chicagoWeekStoreUPCChainedIndices.pdf
Description: Adobe PDF document
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot_date again

2012-02-08 Thread John Hunter
On Wed, Feb 8, 2012 at 1:12 PM, Ted To rainexpec...@theo.to wrote:

 Is it possible to force the date ticks to be the same in two different
 plots?  For example, the attached figures cover the same time spans but
 in one, the data are weekly and the other, monthly.  While there is
 nothing really wrong with different tick marks, aesthetically it would
 be nice if they were both the same.



Yes, just use the sharex keyword to share the x-axis between the two.
 Not only will they have the same ticks and labels, but when you pan and
zoom in one the other moves with it.  The example below does not use dates,
but it will work with dates just the same.


import matplotlib.pyplot as plt
import numpy as np

fig1 = plt.figure(1)
ax1 = fig1.add_subplot(111)
ax1.plot(np.random.randn(10,2)*10)

fig2 = plt.figure(2)
ax2 = fig2.add_subplot(111, sharex=ax1)
ax2.plot(np.random.randn(10,2)*10)

plt.show()

JDH
--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot_date again

2012-02-08 Thread Ted To
On 02/08/2012 02:22 PM, John Hunter wrote:
 
 
 On Wed, Feb 8, 2012 at 1:12 PM, Ted To rainexpec...@theo.to
 mailto:rainexpec...@theo.to wrote:
 
 Is it possible to force the date ticks to be the same in two different
 plots?  For example, the attached figures cover the same time spans but
 in one, the data are weekly and the other, monthly.  While there is
 nothing really wrong with different tick marks, aesthetically it would
 be nice if they were both the same.
 
 
 
 Yes, just use the sharex keyword to share the x-axis between the two.
  Not only will they have the same ticks and labels, but when you pan and
 zoom in one the other moves with it.  The example below does not use
 dates, but it will work with dates just the same.
 
 
 import matplotlib.pyplot as plt
 import numpy as np
 
 fig1 = plt.figure(1)
 ax1 = fig1.add_subplot(111)
 ax1.plot(np.random.randn(10,2)*10)
 
 fig2 = plt.figure(2)
 ax2 = fig2.add_subplot(111, sharex=ax1)
 ax2.plot(np.random.randn(10,2)*10)
 
 plt.show()
 
 JDH

Thanks again, worked like a charm!

Cheers,
Ted

--
Keep Your Developer Skills Current with LearnDevNow!
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-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib tutorial at PyCon US

2012-02-08 Thread Mic
Hi Mike,
Would it possible that after the conference the videos of all talks could
be downloaded? It is not possible to download them from last year.

Thank you in advance.

Cheers,

On Thu, Jan 26, 2012 at 1:43 AM, Mike Müller mmuel...@python-academy.dewrote:

 Hi,

 I will be giving a matplotlib and a optimization tutorial
 at PyCon in March.

 So please point people to it who would like to have a compact
 introduction to matplotlib.

 The optimization tutorial gives an overview over this topic.

 BTW, the early bird deadline is today.

 Mike



 Plotting with matplotlib
 

 Instructor: Mike Müller
 Type:Tutorial
 Audience level:Novice
 Category:Useful libraries
 March 8th 9 a.m. – 12:20 p.m.
 https://us.pycon.org/2012/schedule/presentation/238/

 When it comes to plotting with Python many people think about matplotlib.
 It is
 widely used and provides a simple interface for creating a wide variety of
 plots from very simple diagrams to sophisticated animations. This tutorial
 is a
 hands-on introduction that teaches the basics of matplotlib. Students will
 learn how to create publication-ready plots with just a few lines of
 Python.



 Faster Python Programs through Optimization
 ---

 Instructor: Mike Müller
 Type:Tutorial
 Audience level:Experienced
 Category:Best Practices/Patterns
 March 7th 9 a.m. – 12:20 p.m.
 https://us.pycon.org/2012/schedule/presentation/245/

 This tutorial provides an overview of techniques to improve the
 performance of
 Python programs. The focus is on concepts such as profiling, difference of
 data
 structures and algorithms as well as a selection of tools and libraries
 that
 help to speed up Python.


 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
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] Course Python for Scientists and Engineers in Chicago

2012-02-08 Thread Mic
HI Mike,
Will be videos available from the course?

Thank you in advance.

Cheers,


On Wed, Jan 25, 2012 at 6:52 AM, Mike Müller mmuel...@python-academy.dewrote:

 Course Python for Scientists and Engineers in Chicago
 ===

 There will be a comprehensive Python course for scientists and engineers
 in Chicago end of February / beginning of March 2012. It consists of a
 3-day
 intro and a 2-day advanced section. Both sections can be taken separately
 or combined.

 More details below and here: http://www.dabeaz.com/chicago/science.html

 Please let friends or colleagues who might be interested in such a
 course know about it.


 3-Day Intro Section
 ---

 - Overview of Scientific and Technical Libraries for Python.
 - Numerical Calculations with NumPy
 - Storage and Processing of Large Amounts of Data
 - Graphical Presentation of Scientific Data with matplotlib
 - Object Oriented Programming for Scientific and Technical Projects
 - Open Time for Problem Solving


 2-Day Advanced Section
 --

 - Extending Python with Other Languages
 - Unit Testing
 - Version Control with Mercurial


 The Details
 ---

 The course is hosted by David Beazley (http://www.dabeaz.com).

 Date: Feb 27 - Mar 2, 2012
 Location: Chicago, IL, USA
 Trainer: Mike Müller
 Course Language: English
 Link: http://www.dabeaz.com/chicago/science.html


 --
 Keep Your Developer Skills Current with LearnDevNow!
 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-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
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


[Matplotlib-users] Missing Segments in Output of imshow()

2012-02-08 Thread T J
Hi,

I am experiencing missing segments in the output of imshow().  I draw a
slowly growing line in an array, and then display it.  The line is
continuous but in the output, there are segments missing from it.  Of
course, if I zoom into the picture (before saving to output), then I can
see the lines.  However, if I save directly to a file then the segments are
missing.

Here is a minimal example:


import numpy as np
import matplotlib.pyplot as plt

N = 600
slope = 15
x = np.zeros((N,N))
j = np.arange(N)
i = N/2 - j/slope
for idx in zip(i,j):
x[idx] = 1

plt.imshow(x, interpolation='nearest', cmap=plt.cm.gray_r)
plt.savefig('bug.pdf')
plt.savefig('bug.png')


I have attached an example of the output.  In theory, there should be a
continuous line from the left side of the picture to the right side.  The
problem seems to occur across backends.  Additionally, the thickness of the
segments is not uniform.  Some are thinner than the rest.   Decreasing the
value of N seems to make the issue go away.  Increasing the value of N
makes the problem worse.

Any ideas on what is going on and how I can fix it?


bug.pdf
Description: Adobe PDF document
--
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] Missing Segments in Output of imshow()

2012-02-08 Thread Jerzy Karczmarczuk

 I am experiencing missing segments in the output of imshow()

 Here is a minimal example:

 I have attached an example of the output.  In theory, there should be 
 a continuous line from the left side of the picture to the right side. 
  The problem seems to occur across backends.  Additionally, the 
 thickness of the segments is not uniform.  Some are thinner than the 
 rest.   Decreasing the value of N seems to make the issue go away. 
  Increasing the value of N makes the problem worse.

 Any ideas on what is going on and how I can fix it?

Imshow scales your geometry according to the figure size, and if you 
*insist* on having the nearest interpolation, you may lose pixels 
while drawing, it is as simple as that. No miracles.

How to fix it?
1. Use bilinear, or sinc, or any smooth interpolation.
2. Make your figure big enough, say  plt.figure(figsize=(14,14)).

Jerzy Karczmarczuk


--
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] Missing Segments in Output of imshow()

2012-02-08 Thread Benjamin Root
On Wednesday, February 8, 2012, Jerzy Karczmarczuk 
jerzy.karczmarc...@unicaen.fr wrote:

 I am experiencing missing segments in the output of imshow()

 Here is a minimal example:

 I have attached an example of the output.  In theory, there should be
 a continuous line from the left side of the picture to the right side.
  The problem seems to occur across backends.  Additionally, the
 thickness of the segments is not uniform.  Some are thinner than the
 rest.   Decreasing the value of N seems to make the issue go away.
  Increasing the value of N makes the problem worse.

 Any ideas on what is going on and how I can fix it?

 Imshow scales your geometry according to the figure size, and if you
 *insist* on having the nearest interpolation, you may lose pixels
 while drawing, it is as simple as that. No miracles.

 How to fix it?
 1. Use bilinear, or sinc, or any smooth interpolation.
 2. Make your figure big enough, say  plt.figure(figsize=(14,14)).

 Jerzy Karczmarczuk



Agreed.

Your example above is basically the equivalent of rasterizing a line
(without anti-aliasing) and then down-scaling and possibly causing some
stretching due to changes in aspect ratio.

Because imshow() is unaware the you are actually drawing a line, the
backends can not take advantage of their bag-o-tricks to make it look
good.

Perhaps the example you provided was an oversimplified version of the
problem you are having?

Cheers!
Ben Root
--
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] Missing Segments in Output of imshow()

2012-02-08 Thread Christopher Ellison
Jerzy Karczmarczuk wrote the following on 02/08/2012 05:55 PM:

 I am experiencing missing segments in the output of imshow()

 Here is a minimal example:

 I have attached an example of the output.  In theory, there should be
 a continuous line from the left side of the picture to the right side.
   The problem seems to occur across backends.  Additionally, the
 thickness of the segments is not uniform.  Some are thinner than the
 rest.   Decreasing the value of N seems to make the issue go away.
   Increasing the value of N makes the problem worse.

 Any ideas on what is going on and how I can fix it?

 Imshow scales your geometry according to the figure size, and if you
 *insist* on having the nearest interpolation, you may lose pixels
 while drawing, it is as simple as that. No miracles.

 How to fix it?
 1. Use bilinear, or sinc, or any smooth interpolation.
 2. Make your figure big enough, say  plt.figure(figsize=(14,14)).


Taking the image size to (30,30) made all the segments appear, but their 
thickness was still not uniform.  Using some sort of smoothing helped, 
but it still not displaying what the matrix was specified as: a set of 
blocks, somewhat resembling a line, all of which are the same color and 
thickness.

Can I have matplotlib show the matrix as I have specified it?  Or is 
that too naive (on my part)?


--
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