Re: [Matplotlib-users] many plots

2012-02-05 Thread Jae-Joon Lee
On Sat, Feb 4, 2012 at 1:27 AM, Saurav Pathak sau...@sas.upenn.edu wrote:
 Is there another way to do this more efficiently?

I recommend you to use LineCollection, which should be much efficient.

http://matplotlib.sourceforge.net/examples/api/collections_demo.html

Regards,

-JJ

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


Re: [Matplotlib-users] legend not draggable when secondary y-axis present

2012-02-05 Thread Jae-Joon Lee
For the legend to be picked by mouse, it must be placed in the top most axes.

ax = subplot(111)
l1, = ax.plot([1,3,2])
ax2 = ax.twinx()
lab = ax2.legend([l1], [test])

I hope this clarifies your issue.
If not, please post a simple but complete example that demonstrates
your problem.

Regards,

-JJ



On Wed, Jan 18, 2012 at 12:53 AM, German Salazar salger...@gmail.com wrote:
 Any ideas?

 Also, as in the example here, the legend seems to be behind the quantity
 being plotted against the one of the secondary y-axisdoes this have
 anything to do with that?...it is that maybe the legend is draggable but I
 am not getting to it?

 gsal


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


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


Re: [Matplotlib-users] Why pixel marker size is 4 pixels?

2012-02-05 Thread Jae-Joon Lee
How are you plotting your points.

If you use *plot*, there is a *markersize* parameter.
If you use *scatter*, the third argument controls the marker size.

But you may actually complaining about other issues, e.g.,
antialiasing, etc. So, if above are not your answer, please post a
complete example and describe your problem in more detail.

Regards,

-JJ


On Sat, Feb 4, 2012 at 2:15 PM, Chris plut...@gmail.com wrote:
 I noticed this a few years back, but left it aside because most of the
 time I can live with it.  Recently I need to make a few plots
 containing a few million points, and 4 pixels for a point is a
 disaster.  So my question is why the pixel marker size is set at 4
 pixels?  And is there anyway to change it to a single pixel?

 Thanks,
 Chris

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

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


Re: [Matplotlib-users] legend not draggable when secondary y-axis present

2012-02-05 Thread gsal

Yeap, that did the trick.

Thanks.
-- 
View this message in context: 
http://old.nabble.com/legend-not-draggable-when-secondary-y-axis-present-tp33163397p33266687.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


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


Re: [Matplotlib-users] Why pixel marker size is 4 pixels?

2012-02-05 Thread Chris
Thanks JJ.

The problem seems not to be a size issue --  markersize has no effect
when use marker=, (pixel).  I have also tried to turn off aa, and it
doesn't help either.  I also tried different backends.  The PNG output
from Agg and Cairo is slightly different: Agg's point has 4 solid
pixel, while Cairo's has 4 pixel with random shade.

Postscript output has the same problem.  The pixel in an EPS file
generated by mpl is significantly bigger than that from another
drawing program I used.

The problem occurs in all my plotting scripts, e.g., this basic one:

[CODE]
import numpy as np

x=np.arange(100)
y=np.random.randn(100)

ioff()
fig=gcf()
fig.clf()

ax=fig.add_axes(0.15,0.1,0.8, 0.85)
ax.plot(x,y,k,)

ion()
fig.canvas.draw()
[/CODE]

Here is how I identify the problem:
1. use the above script to plot on screen
2. savefig(plot.png)
3. open plot.png in GIMP and check the pixel size.

I also attached the two PNG files generated with Agg and Cairo backends.


On Sun, Feb 5, 2012 at 6:45 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote:
 How are you plotting your points.

 If you use *plot*, there is a *markersize* parameter.
 If you use *scatter*, the third argument controls the marker size.

 But you may actually complaining about other issues, e.g.,
 antialiasing, etc. So, if above are not your answer, please post a
 complete example and describe your problem in more detail.

 Regards,

 -JJ


 On Sat, Feb 4, 2012 at 2:15 PM, Chris plut...@gmail.com wrote:
 I noticed this a few years back, but left it aside because most of the
 time I can live with it.  Recently I need to make a few plots
 containing a few million points, and 4 pixels for a point is a
 disaster.  So my question is why the pixel marker size is set at 4
 pixels?  And is there anyway to change it to a single pixel?

 Thanks,
 Chris

 --
 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
attachment: plot.agg.pngattachment: plot.cairo.png--
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] axes.hist gets fooled by intermixed colors as strings and RGB

2012-02-05 Thread Martin Mokrejs
HI,
  I have troubles getting to wirk a hitogram plot. I have colors in
RGB as tuples of 3 values and also some colors defined as string,
e.g. 'orange'. I get the folowing error:

  File /usr/lib64/python2.7/site-packages/matplotlib/pyplot.py, line 2332, in 
hist
ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, 
histtype, align, orientation, rwidth, log, color, label, **kwargs)
  File /usr/lib64/python2.7/site-packages/matplotlib/axes.py, line 7598, in 
hist
raise ValueError(color kwarg must have one color per dataset)
ValueError: color kwarg must have one color per dataset


  I think it is about the code in this patch:
http://permalink.gmane.org/gmane.comp.python.matplotlib.scm/4600

  I hacked a bit the code in colors.py and axes.py to get more debug.
As you can see below it seems a previous value if left in the colors variable
from a previous iteration (I think).

['orange', (0.9468480101059871, 1.0, 0.0)] = colors[:2]

[cut]

pylab.hist(counts[:2], histtype='bar', align='mid', log=True, 
bins=len(counts[:2]), color=colors[:2], label=adapternames[:2])
  File /usr/lib64/python2.7/site-packages/matplotlib/pyplot.py, line 2332, in 
hist
ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, 
histtype, align, orientation, rwidth, log, color, label, **kwargs)
  File /usr/lib64/python2.7/site-packages/matplotlib/axes.py, line 7598, in 
hist
raise ValueError(color kwarg must have one color per dataset: color=%d, 
nx=%d, color='%s', nx='%s' % (len(color), nx, str(color), str(nx)))
ValueError: color kwarg must have one color per dataset: color=2, nx=1, 
color='[[ 1.  0.64705882  0.  1.]
 [ 0.94684801  1.  0.  1.]]', nx='1'


  Alternatively I would believe that matplotlib breaks because I have for 
different
data points same color ('orange' appears maybe 10x in my colors list) but the 
above slice [:2]
excludes this a the cause I am getting right now.


If it matters I generated the colors by this approach:
for _n in range(1,cnt1 + 1):
_h1 = sorted([uniform(0.15, 0.85) for x in range(_n)])
_HSV_tuples1 = [(_h1[x], 1.0, 1.0) for x in range(_n)]
_RGB_tuples1 = map(lambda x: colorsys.hsv_to_rgb(*x), _HSV_tuples1)
but these are mixed together with those defined as string (e.g. 'orange')
before they are sent to matplotlib.

Thank you for you help.
Martin
BTW: Would be nice if the default error messages on the above shown raise() were
more detailed.

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