Re: [Matplotlib-users] Call for new style defaults

2015-07-12 Thread Pierre Haessig

Le 12/07/2015 18:11, Thomas Caswell a écrit :
 I recommend everyone watch Nathaniel Smith and Stéfan van der Walt's
 talk from SciPy2015 introducing the new color map and providing an
 introduction to the math of color
 perception: https://www.youtube.com/watch?v=xAoljeRJ3lU

Great presentation, thanks for sharing !

-- 
Pierre

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-03 Thread Pierre Haessig
Le 02/11/2014 09:34, Scott Lasley a écrit :
 I wish I could say that it was because of a deep understanding of the inner 
 workings of matplotlib or a rock solid grasp of python 3's bytes vs strings, 
 but it wasn't.   fig.savefig threw the TypeError: string argument expected, 
 got 'bytes' exception, so I figured BytesIO might work better with the 
 binary png data than StringIO, and it did.
As a side note on the bytes vs strings topic, there is PyCon video 
that I found immensely useful:
Pragmatic Unicode, or How Do I Stop the Pain 
http://nedbatchelder.com/text/unipain.html
IMHO a 30 minutes talk worth watching.

best,
Pierre

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Equivalent of d3's step-after interpolation?

2014-10-30 Thread Pierre Haessig
You might also be interested in 
http://stackoverflow.com/questions/15188005/linestyle-in-matplotlib-step-function
which details the `drawstyle` parameters. It can be set to 'steps-post' 
for example.

The only case I was not able to cover with this parameter are the 
fill_between plots, because they do not use Line objects...

-- 
Pierre

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using unregistered scales

2014-10-08 Thread Pierre Haessig
Hi Paul,

Le 06/10/2014 22:27, Paul Hobson a écrit :
 I built a ProbabilityScale[2] which I hope one day will be in the 
 statsmodels library.
This just made me think that back in April I was also playing with 
matplotlib scales for probability distribution.
http://nbviewer.ipython.org/gist/pierre-haessig/7e3e6a818edeb6819708

It's actually a completely different idea, because I was doing a logit 
scale to get a good visualization of *tails* in a cumulated distribution 
plot. So I'm jumping on your thread in case anyone can give me some 
feedback on this idea. For example, I have no clue on how common this 
kind of plot is (and how useful it can be!!).

best,
Pierre

(and going back to your original question, I notice that I was indeed 
registering the scale...)


--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Question about copy_from_bbox

2014-04-01 Thread Pierre Haessig
Hi Michka,

I haven't practiced PyQt for some time, but I think I remember there is
a common practice of using a 0 ms timer to launch a function after the
Gui setup.

I've modified your gist here :
https://gist.github.com/pierre-haessig/9909708
(for some reason the Github fork button printed The change you wanted
was rejected.)

I don't know if it does what you want, but at least it doesn't move anymore.

best,
Pierre

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] pure Qt data visualization (not open source)

2014-03-28 Thread Pierre Haessig
Hi,

I just ran across this new Qt add-on for data visualization :
blog.qt.digia.com/blog/2014/03/26/qt-data-visualization-1-0-released/

It's a bit off-topic because I think there is not (yet?) a Python
binding, but there is a demo video which is worth taking a look at.
The video doesn't mention the API so the question is open : how easy is
it to build these visualization GUIs, compared to Mayavi for instance ?
(one minor difference at least... not open source)

In the same category, but focusing on 2D plots, I see that Digia has
also produced a Qt Charts add-on. This one has a Python binding
http://www.riverbankcomputing.co.uk/software/pyqtchart/intro (commercial
license only)

-- 
Pierre

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Changing figure background color (through rcparams?)

2014-03-26 Thread Pierre Haessig
Hi,

True enough, I didn't tested in a Notebook, but now it seems to work as
well:

https://gist.github.com/pierre-haessig/9779940
http://nbviewer.ipython.org/gist/pierre-haessig/9779940

(just a test with mpl.rcParams['axes.facecolor'] = 'red')

best,
Pierre

Le 25/03/2014 18:20, Adam Hughes a écrit :
 Thanks Pierre.

 I tried this with several different color types and couldn't see any
 difference in my plots in the notebook.  Did you by chance try this
 out and see a difference?


 On Tue, Mar 25, 2014 at 9:51 AM, Pierre Haessig
 pierre.haes...@crans.org mailto:pierre.haes...@crans.org wrote:

 Hi,

 Le 20/03/2014 18:40, Adam Hughes a écrit :
  I am using an IPython notebook style that has a soft, yellow
  background that I think is more appealing that white.  When I make a
  plot, I'd like the background of the plot (ie, everything that is
  outside the x and y axis) to be the same color.  I'm trying to
 change
  the figure.facecolor parameter through rc params but I don't see any
  changes.  Is figure.facecolor event he correct parameter?
 
  Has anyone done this successfully?
 
 I think that 'axes.facecolor' does the job.

 'figure.facecolor' changes the background of the figure outside the
 plots (axes), that is the background color of the windows (which
 is not
 visible in the Notebook).

 best,
 Pierre


 
 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases
 and their
 applications. Written by three acclaimed leaders in the field,
 this first edition is now available. Download your free book today!
 http://p.sf.net/sfu/13534_NeoTech
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users





signature.asc
Description: OpenPGP digital signature
--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Changing figure background color (through rcparams?)

2014-03-25 Thread Pierre Haessig
Hi,

Le 20/03/2014 18:40, Adam Hughes a écrit :
 I am using an IPython notebook style that has a soft, yellow
 background that I think is more appealing that white.  When I make a
 plot, I'd like the background of the plot (ie, everything that is
 outside the x and y axis) to be the same color.  I'm trying to change
 the figure.facecolor parameter through rc params but I don't see any
 changes.  Is figure.facecolor event he correct parameter?

 Has anyone done this successfully?

I think that 'axes.facecolor' does the job.

'figure.facecolor' changes the background of the figure outside the
plots (axes), that is the background color of the windows (which is not
visible in the Notebook).

best,
Pierre


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib for tiles - blank lines

2014-03-24 Thread Pierre Haessig
Hi,

Le 24/03/2014 10:45, Jesper Larsen a écrit :
 I am using matplotlib to produce plots (tiles) in a Web Map Service.
 Unfortunately I cannot get Matplotlib to plot on the entire image.
 There are one transparent (pixel) line at the bottom and one
 transparent line at the right. This is of course a problem when the
 tiles are shown in a map. Please see example below. Can anyone see
 what I am doing wrong?
I've run your code and got no transparent pixels.

print im.getcolors()
[(65536, (0, 0, 128, 255))]

I also tried with __future__ division to see if there was something with
figsize = w/dpi, h/dpi, but got the same output

best,
Pierre

(python 2.7 on Linux, mpl 1.3.1)


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow for .png- low resultion

2014-03-06 Thread Pierre Haessig
Le 05/03/2014 22:37, Asma Riyaz a écrit :
 img= mpimg.imread('/home/asmariyaz/Desktop/mytree.png')
 phyl_ax.imshow(img,interpolation='nearest')
Ok, so here you could try replace 'nearest' by 'bilinear' or 'bicubic'.
I believe those are the most common choices for image resampling
(because when you plot an image and then save it, there is a resampling
involved).
(http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.imshow for
the other options)

Of course, it's also worth playing the dpi argument of savefig, as
suggested by Eric.

best,
Pierre
attachment: pierre_haessig.vcf

signature.asc
Description: OpenPGP digital signature
--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow for .png- low resultion

2014-03-05 Thread Pierre Haessig

Hi Asma,
Le 05/03/2014 21:19, Asma Riyaz a écrit :
I am trying to merge a heat map(matplotlib) with a tree(.png), but the 
.png does not plot as needed or for that matter cannot be seen easily. 
Here is my code:


### CODE
 []
   img = ht_ax.imshow(data, cmap=cmap, 
interpolation='none',vmax=threshold)

   []

How can I make the resolution of the .png image better OR for that 
matter is there a better solution to merge these together?


I see the imshow call to plot the matrix but not the one you use to plot 
the png image. Could it be that the poor image rendering is due to a bad 
choice for the interpolation param ?


best,
Pierre
--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Pierre Haessig
Hi,

In order to get a plot with a small number of ticks, it is possible to
create a matplotlib.ticker.MaxNLocator object with a small value for
`nbins`.

However, I found it also possible to modify the existing AutoLocator
instances, since AutoLocator derives from MaxNLocator :

ax.xaxis.major.locator.set_params(nbins=5)
ax.yaxis.major.locator.set_params(nbins=5)

(the default nbins value seems to be 9)

The advantage of this inplace solution is that it doesn't any
importing/browsing in the mpl namespace. However, it's still a bit long.

I was then wondering :
1) is this solution recommended or not ?
2) is there a shortcup to avoird the five dots ?

best,
Pierre
attachment: pierre_haessig.vcf

signature.asc
Description: OpenPGP digital signature
--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Pierre Haessig
Le 17/02/2014 18:13, Eric Firing a écrit :
  I was then wondering :
  1) is this solution recommended or not ?
  2) is there a shortcup to avoird the five dots ?
 http://matplotlib.org/api/pyplot_api.html?highlight=locator_params#matplotlib.pyplot.locator_params

 This is both a pyplot function and an Axes method.
Thanks a lot!

I guess it would be nice to add a back reference to this method in
http://matplotlib.org/api/ticker_api.html

best,
Pierre
attachment: pierre_haessig.vcf

signature.asc
Description: OpenPGP digital signature
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] completely filling a figure canvas

2014-02-13 Thread Pierre Haessig
Hi Andreas,

Le 14/02/2014 08:12, Andreas Hilboll a écrit :
 Is there a way to have subplots_adjust() automatically chose left,
 right, bottom, top values so that everything that's been drawn tightly
 fits the figure? 
What about plt.tight_layout() ?
(or fig.tight_layout )

best,
Pierre

attachment: pierre_haessig.vcf--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Interative legend manipulation?

2014-01-08 Thread Pierre Haessig
Le 07/01/2014 17:51, Paul Hobson a écrit :
 I believe (as of v1.3.1) that after you create the legend you call
 leg.draggable(True)
I had never heard of that nice possibility!

Would it make sense to add a few lines to the Legend Guide/Legend location ?
http://matplotlib.org/users/legend_guide.html#legend-location

and possibly to the legend demo ?
http://matplotlib.org/examples/api/legend_demo.html

(and remove 
http://matplotlib.org/examples/old_animation/draggable_legend.html ?)

best,
Pierre

attachment: pierre_haessig.vcf

signature.asc
Description: OpenPGP digital signature
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Some help with PyQt

2013-08-30 Thread Pierre Haessig
Hi Eric,

Le 29/08/2013 19:51, Eric Frederich a écrit :
 I took the example that ships with 1.3.0 and have modified it to use a
 grid layout and show 9 graphs in a 3x3 grid.
 When I do this it, other widgets become rather unresponsive.
 Is there a way to fix this?
 Somehow offload whatever is hogging CPU onto another thread or something?
I just ran your code on my computer and I don't get the unresponsive
widgets problem. The program takes 6% of one CPU.

Yet the slider is not totally fluid. It gets better if I slowdown the
plot update timer.

Do you run your code on a powerful computer ?

best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] major/minor grid settings in matplotlibrc

2013-06-03 Thread Pierre Haessig
Le 31/05/2013 13:15, Pierre Haessig a écrit :
 Would it make sense to add also grid.major.* and grid.minor.* (as it
 already exists for xticks) ?
any feedback ?
-- 
Pierre

--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with 2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Unicode characters in PS output

2013-02-28 Thread Pierre Haessig
Hi Thomas,

Le 27/02/2013 20:59, Thomas Sprinzing a écrit :
 To sum it up: use the old 7-bit equivalent for the degree sign, not any 
 fancydancy UTF-8 character that is commonly not included in ye olde style 
 postscript standard font embedded into your laser printer wy back then in 
 the last millenium... 
Just out of curiosity, I looked at the list of ASCII printable
characters
(http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) and
didn't find the degree sign. However, I found it in the so-called 8
bits extensions, which I believe is just the same as the Unicode U+00B0
character.

best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cross correlation

2013-02-28 Thread Pierre Haessig
Hi,

Le 27/02/2013 10:01, Sudheer Joseph a écrit :
 I was checking the plt.xcorr and it calls the np.correlate in side it.
 It calls np.correlate(ts1,ts2, mode=2).
Just as a side note, mode=2 is the old fashioned way to specify
mode='full' [1]. This may help in reading the numpy.correlate doc.

This being said, I'm really unfamiliar with cross-correlations. I just
kind of know the usual 95% confidence interval for autocorrelation at
1.96/sqrt(n). Just as a quick check, this is what R uses by default, but
there are options like ci.type get more appropriate intervals for an MA
series
(http://stat.ethz.ch/R-manual/R-patched/library/stats/html/plot.acf.html)

best,
Pierre

[1] https://github.com/numpy/numpy/blob/master/numpy/core/numeric.py#L678



signature.asc
Description: OpenPGP digital signature
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Unicode characters in PS output

2013-02-26 Thread Pierre Haessig
Hi,

Le 26/02/2013 12:38, Gökhan Sever a écrit :

 fp = plt.figure(figsize=(8.5, 11))
 fp.text(0.5, 0.5, uTemperature, \u00B0C, color='black', fontsize=16)
 plt.savefig('test.ps http://test.ps', papertype='letter')
 plt.savefig('test.pdf', papertype='letter')

 Just a thought. Hope it helps.

 Ryan


 This works fine. However it is easy to remember a superscript o then
 its code :) By the way, can you select the text within the PS file? 

I just noticed that you are using here the character U+2070 superscript
zero (^(0)) while Ryan's proposition is U+00B0 degree sign (°) which
I think is the correct one to use.

This being said, there should be no difference between using the Unicode
code and actual ° character (and I agree it's simpler to remember)

In [1]: a = uTemperature, \u00B0C
In [2]: a
Out[2]: u'Temperature, \xb0C'

In [6]: b = uTemperature °C
In [7]: b
Out[7]: u'Temperature \xb0C'


Coming back to your other question, I can't select the text in the PS
file (using Okular or Evince). (but PDF is selectable)

Also, the PS file renders properly with both ^(0) and ° signs. (but
with PDF, the ^(0) is placed to low, while ° is fine)

Best,
Pierre


signature.asc
Description: OpenPGP digital signature
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Unicode characters in PS output

2013-02-26 Thread Pierre Haessig
Le 26/02/2013 14:38, Gökhan Sever a écrit :

 Could you test my outputs if they look fine on your side?

 http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf
 http://atmos.uwyo.edu/%7Egsever/data/matplotlib/test.pdf
 http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps
 http://atmos.uwyo.edu/%7Egsever/data/matplotlib/test.ps

Good idea !

* your PDF file looks fine with Okular
* your PS indeed has the problem you describe (again Okular) :
  - ° (degree sign) is fine
  - but ⁰ (zero superscript) is replaced by ?

In case it may explain the difference : I'm using mpl 1.1.1rc2 from
Debian testing
and I have the following line in my matplotlibrc (is it relevant ???)

font.sans-serif : DejaVu Sans, sans-serif

Best,
Pierre


signature.asc
Description: OpenPGP digital signature
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cross correlation

2013-02-21 Thread Pierre Haessig
Hi Sudheer,

Le 21/02/2013 02:22, Sudheer Joseph a écrit :
 Thank you  very much Smith and Paul,
   I was away from office due
 to a medical situation. So could not respond and thank you regarding
 the help. I have got the results now and the tips from both of you
 were extremely useful. I am facing an issue with the code when I call
 plt.xcorr,  in a loop. it builds up usage of memory by python and
 reaches to the RAM what ever available ( in my 4 GB laptop it reaches
 almost full and in my 24 GB desktop it reaches the available. I
 suspected the plot not being closed during each iteration so have
 given a plt.close('all') in the loop. after which it is taking a good
 time to run the code which was otherwise faster until ram usage
 reaches its maximum.
 Is there a way to get out of this situation?. I am attaching the code
 here and also the link to the data I am using. If possible kindly help.


Thanks for sharing the code. By a quick look at gen_xcorr_wnd.py, you
are generating a quite high number (about len(lons)*len(lats)) of xcorr
series over 365 lags. Here are two thoughts about why I would not
recommend using xcorr from matplotlib for this job :

1) There is an overhead in creating a plot object which is unnecessary
since you're only interested in correlation values

2) internally, plt.xcorr uses numpy.correlate
(https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes.py#L4319
and
https://github.com/numpy/numpy/blob/master/numpy/core/numeric.py#L731)
which is quite fast but unfortunately cannot be well tuned in terms of
the output length (only three modes : 'valid', 'same' or 'full'.
Matplotlib uses 'full' )
All this to say that when you're interested in 365 correlation values,
the internal computations takes place on (N+M-1) points (where N, M are
the length of the input vectors, i.e. 2189 if I'm right) and so about 90
% of the output is thrown away.



This being said, there is a tiny issue : I don't know a good module
which has the (x)correlation function. statsmodel has acf (aka
correlation) but I don't remember if there is crosscorrelation. For acf
has two computation modes : one based on fft, one based on
numpy.correlate which suffer from the same problem as matplotlib's xcorr
(
https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/stattools.py#L347)

best,
Pierre


signature.asc
Description: OpenPGP digital signature
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cross correlation

2013-02-21 Thread Pierre Haessig
Le 21/02/2013 17:33, Sudheer Joseph a écrit :
 Thank you Pierre,
   I will test the other options. I did not
 know the number limitation in case of plt.xcorr.
 Thanks a lot
 with best regards,
Just for reference  :
http://stackoverflow.com/questions/6991471/computing-cross-correlation-function
You'll see that (cross)correlation in Python a long ongoing topic.

best,
Pierre


signature.asc
Description: OpenPGP digital signature
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] filled step plot?

2013-01-28 Thread Pierre Haessig
Hi,

Le 27/01/2013 00:35, Skipper Seabold a écrit :
 This has been asked before, and I just filed a ticket [1]. Can anyone
 think of a better way to do something like this? The fill_between
 below is pretty suboptimal IMO.
I feel that adding a filled step plot would indeed be useful.

Just thinking at a possible API, would it make sense to add the
drawstyle argument which already exists for plot() to fill_between() ?

best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Novice question: Am I using pyplot.rgrids correctly?

2012-12-18 Thread Pierre Haessig
Hi Andre,

Le 18/12/2012 06:52, Andre' Walker-Loud a écrit :
 There is no mention in the docs about the treatment of negative r.  The 
 treatment is contrary to my expectations, and I would wager contrary to many 
 peoples expectations.  So at a new minimum, at the very least, the docs 
 should make clear what is happening.

 I would further suggest that there are options specified by kwargs what the 
 behavior is.  The default could be the current behavior, which sounds like it 
 is standard to some, and another option would be to complain if r  0, as I 
 think many others would expect.
I fully agree with the idea of enabling users to specify the behavior
they want. I'm not sure about raising an error, but it's true that it
can be pretty helpful to detect computational mistakes.

The way polar plots are implemented now seems to be a generalization of
usual polar coordinate mapping. Indeed, we have in [1] the following
mapping (let's call it T) :

T : (r, θ) ⟶ ((r-rmin) cos(θ), (r-rmin) sin(θ) )

which is parametrized by rmin.
Currently this 'rmin' is get from the ymin property of axis.viewLim
which can be set by ax.set_lim(ymin=...)

I see this radius offsetting functionality pretty useful in some cases
like drawing antenna diagrams in dB like [2]. For such a usecase, a
radius (ie r-rmin) going negative could raise an error.

In some other usecases like with a polar rose [3], the radius going
negative (and indeed it may not be called radius anymore...) is
perfectly legitimate and is the expected behavior. Also, the mapping T
currently implemented in [1] supports it perfectly.


In conclusion, I think matplotlib in its currently almost perfectly(*)
able to deal with both use cases thanks to this parametrized polar
mapping T. However, the current state of the documentation doesn't
reflects this flexibility. Also, an additional keyword argument could
help to specify the expected behavior, especially in term of error raising.

Best,
Pierre


[1]
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/projections/polar.py#L61
[2] https://hamstudy.org/browse/E4_2012/E9B
[3] http://en.wikipedia.org/wiki/Polar_coordinate_system#Polar_rose
(*) rgrids function raises an error for negative r values (see
polar.py#L537). This could be annoying for radiation patterns in dB

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Novice question: Am I using pyplot.rgrids correctly?

2012-12-18 Thread Pierre Haessig
Le 18/12/2012 11:13, Bob Dowling a écrit :
 Any how, the answer seems to be yes I'm using rgrids() correctly, but 
 no I'm not using matplotlib-friendly data points.  I shall adjust my 
 values of (r,th).
You don't need to change your (r,th) values. The two workarounds I see
to get your version2 script work are :

1) Either call rgrids *after* plotting :

subplot(111, polar=True)
polar(t, r)
rgrids([2,4,6])


2) or call ylim to change the rmin parameter which tunes the radius
offset :

subplot(111, polar=True)
rgrids([2,4,6])
polar(t, r)
ylim(ymin=0) # or ylim(0,8) which looks even better in your specific case


Best,
Pierre




signature.asc
Description: OpenPGP digital signature
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Novice question: Am I using pyplot.rgrids correctly?

2012-12-17 Thread Pierre Haessig
Hi Bob,

Le 17/12/2012 19:09, Bob Dowling a écrit :

 I am plotting a polar graph with some negative values of r. 
 Everything goes well until I try to use rgrids().  Am I doing
 something wrong? 
I just noticed that calling rgrids *after* plotting works nicely for me:

subplot(111, polar=True)
polar(t, r)
rgrids([2,4,6])

However, calling rgrids before plotting indeed leads to a weird
situation where only half of the curve is plotted. After digging in the
source code, this may relate to the `use_rmin` parameter in the
PolarTransform class init (in matplotlib.projections.polar)

In the tranform_non_affine method I see
# line 40-42:
if self._axis is not None:
if self._use_rmin:
rmin = self._axis.viewLim.ymin
# [...]
if rmin != 0:
r = r - rmin
mask = r  0
x[:] = np.where(mask, np.nan, r * np.cos(t))
y[:] = np.where(mask, np.nan, r * np.sin(t))
else:
x[:] = r * np.cos(t)
y[:] = r * np.sin(t)


Maybe this the code behind the masking of half your curve, but I don't
know more.

Best,
Pierre



--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Novice question: Am I using pyplot.rgrids correctly?

2012-12-17 Thread Pierre Haessig
Le 17/12/2012 21:59, Pierre Haessig a écrit :
 Maybe this the code behind the masking of half your curve, but I don't
 know more.
Looking closer at the plot, the curve is actually not masked !

Actually the rmin functionality' is activated with rmin=-2*pi so that
the whole r-axis is offset by +2pi. The plot is therefore pretty
consistent only it is not what you want, I guess.
I don't know how to disable this radius offset functionality.

Best,
Pierre


--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hiding axis

2012-12-04 Thread Pierre Haessig
Hi,

Le 29/11/2012 20:42, Vilson Vieira a écrit :
 I tried the no_clip function but it didn't worked:
 https://gist.github.com/4171341

I just edited your file :
https://gist.github.com/4203760

I made 2 changes:
 * added a call to random.seed to make you code reproductible.
 * altered the call to set_clip_on(False). It should be called on the
Line2D object returned by plot()

I think it solves your clipping problem.

Best,
Pierre




signature.asc
Description: OpenPGP digital signature
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mailing list archive broken ?

2012-11-28 Thread Pierre Haessig
Hi Phil,

Le 28/11/2012 12:58, Phil Elson a écrit :
 I've just submitted a pull request
 (https://github.com/matplotlib/matplotlib/pull/1540) to get the mpl
 docs to link to the nabble archive instead
 (http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
 http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html).
Great ! I'm not so familiar with the nabble archive service, but at
first glance it looks way better than sourceforge (beyond the fact their
archiving service is pretty dead ;-) ).

Best,
Pierre


signature.asc
Description: OpenPGP digital signature
--
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] dpi

2012-10-19 Thread Pierre Haessig
Hi,

Le 19/10/2012 06:48, Jae-Joon Lee a écrit :
 Figuring out the dpi of the screen, I have no clue at this moment.
 Maybe this is something a gui expert can answer.
I'm certainly not a gui expert, but as a PyQt user, I know screen
resolution is indeed Python-accessible with PyQt. (I guess other
toolkits provide their own methods)

I've made a quick script that prints the screen X and Y resolution
(requires PyQt). Reference links to PyQt API docs are included.


In my case, it's 96 dpi, and that what I use in my matplotlibrc file for
the figure.dpi property. But I use a higher value (say 150) for
savefig.dpi so that I get better resolution when saving PNG images.

I agree with Nikolaus that the dpi value for displaying figures would be
better get by the software, if possible. Maybe a property like
figure.dpi='auto' should activate such a behavior. But this would
require many code duplicates, one for each gui toolkit.


Best,
Pierre
#!/usr/bin/python
# -*- coding: UTF-8 -*-

Diplay the Screen resolution information from PyQt

References
---
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qapplication.html#desktop
http://qt-project.org/doc/qt-4.8/qapplication.html#desktop

http://lists.trolltech.com/qt-interest/2008-08/thread00258-0.html

Pierre Haessig — October 2012

import sys
from PyQt4.QtGui import QApplication

app = QApplication(sys.argv)
desktop_widget = app.desktop()
print('Screen resolution:')
print('%d x %d DPI' % (desktop_widget.physicalDpiX(),
   desktop_widget.physicalDpiY() ))


signature.asc
Description: OpenPGP digital signature
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] trouble switching off smoothing in imshow()

2012-10-09 Thread Pierre Haessig
Hi,
Le 09/10/2012 16:37, Warren Weckesser a écrit :

 That's strange.  `imshow(img, interpolation='nearest')` works for me.


I'm not sure I understand well the subtle difference between 'nearest'
and 'none' interpolations, but I found in this commit
https://github.com/jkseppan/matplotlib/commit/6923c7f04fbafa23766250d710cc6b37373c816f
a PDF file (interp_nearest_vs_none.pdf) which compares the output of
imshow with these two different settings. It seems there is a difference
in where the boundaries of pixels are...

Maybe somebody familiar with this 'nearest' and 'none' topic could edit
the interpolation example ?
(http://matplotlib.org/examples/pylab_examples/image_interp.html)

Best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] mailing list archive broken ?

2012-10-04 Thread Pierre Haessig
Hi,

Is it just my web browser getting crazy or is there a real issue with
the ML archive on sourceforge:
http://sourceforge.net/mailarchive/forum.php?forum_name=matplotlib-users

I only see email records until July 16th 2012 !!

If there is another ML archive website in better shape, it would be
worth updating the link on matplotlib.org front page
(Documentation/need help? section)

Best,
Pierre





signature.asc
Description: OpenPGP digital signature
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
Hi Fernando,

Le 04/10/2012 09:16, Fernando Perez a écrit :
 This would make for an awesome couple of examples for the gallery, the
 mathematica solutions look really pretty cool:

 http://mathematica.stackexchange.com/questions/11350/xkcd-style-graphs
I've never used Mathematica so that it's pretty difficult for me to
understand the following lines of code which I guess do the main job of
distorting the image

xkcdDistort[p_] := Module[{r, ix, iy},
   r = ImagePad[Rasterize@p, 10, Padding - White];
   {ix, iy} =
Table[RandomImage[{-1, 1}, ImageDimensions@r]~ImageConvolve~
  GaussianMatrix[10], {2}];
   ImagePad[ImageTransformation[r,
 # + 15 {ImageValue[ix, #], ImageValue[iy, #]} , DataRange -
Full], -5]];


Is there somebody there that can describe this algorithm with words
(English or Python ;-)) ?

I feel like the key point is about adressing the rasterized plot image
r with some slightly randomized indices ix and iy. However, I
really don't get the step that generates these indices.

Best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
Le 04/10/2012 14:29, Phil Elson a écrit :
 Damon, I love the solution! I do wonder whether we could do some
 quirky transform on the lines to achieve a similar result, rather than
 manipulating the data before plotting it. The benefit is that
 everything should then get randomly Xkcd-ed automatically - maybe I
 will save that one for a rainy day


A different solution to get the shaken effect on every graphic items is
the post-processing of a raster rendering of the plot. I think this is
what was proposed with Mathematica though I'm really unfamiliar with its
syntax

One way I see to shake on image would be to use
scipy.ndimage.interpolation.map_coordinates [1] to interpolate the
rastered plot image with a shaken grid. This shaken grid would be a
regular 2D indexing grid + some 2D noise, carefully tuned to have a bit
of spatial correlation.
I'm not so familiar with image processing in Python though, so there may
be better solutions I'm not aware of.

Best,
Pierre

[1]
http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.interpolation.map_coordinates.htm



signature.asc
Description: OpenPGP digital signature
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
Le 04/10/2012 16:03, Jason Grout a écrit :
 f@r means f(r)

 a~ImageConvolve~b means ImageConvolve(a,b)  (~ treats an operator as infix)

 Table[..., {2}] means [... for i in range(2)]

 #+1 is a lambda function lambda x: x+1

 So I think it goes something like:

 def xkcdDistort(p):
  r = ImagePad(Rasterize(p), 10, Padding='White')
  (ix, iy) = [ImageConvolve(RandomImage([-1,1], ImageDimensions(r)),
GaussianMatrix(10))
  for i in range(2)]
  return ImagePad(ImageTransformation(r,
  lambda coord: (coord[0]+15*ImageValue(ix, coord),
 coord[1]+15*ImageValue(iy, coord)),
   DataRange='Full'),
-5)
Thanks a lot!

It's the first time I encounter Mathematica syntax. Some of these
functional notations are not so easy to follow for my unexperienced eyes
but it makes this Mathematica code nicely compact.

So I think this code indeed resamples the rastered plot image on a
shaken coordinate grid. I kind of understand that the noise on
coordinates is spatially smoothed by a 10px Gaussian Point Spread
Function (if I understand correctly...)

Best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
Le 04/10/2012 16:11, Michael Droettboom a écrit :
 Yes -- this would be a great application for the path filtering 
 infrastructure that matplotlib has.
Sounds way cooler than post-processing a raster plot image !

I'm not aware of this path filtering infrastructure. I guess it's a
deeply buried facility which is not accessible in the Python user space ?

Best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
Le 04/10/2012 16:54, Damon McDougall a écrit :
 Adding Gaussian noise to each point on a function doesn't look nice.
 That's why I produced a random function in Fourier space first. That
 way, random functions still have some sense of smoothness.
Mathematica code seems to use a Gaussian *smoothing* of a uniform noise.
I understand this as the spatial-domain-way (using convolution) to get
some smoothness while you've taken the frequency-domain path. It's a
matter of taste and I guess that both ways should be ok !

Best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] example of pareto chart

2012-09-26 Thread Pierre Haessig
Hi,

Just a detail :

Le 26/09/2012 04:29, Paul Tremblay a écrit :
 percent = (np.divide(the_cumsum, the_sum)) * 100
This lines doesn't work on my computer (numpy 1.6.2)

Indeed, there is a casting issue :
In [2]: percent
Out[2]: array([  0,   0,   0,   0, 100])

However, using the regular / operator instead of np.divide gives the
proper result:
In [8]: the_cumsum/the_sum*100
Out[8]: array([  42.10526316,   71.05263158,   90.78947368,  
97.36842105,  100.])

Best,
Pierre


signature.asc
Description: OpenPGP digital signature
--
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] example of pareto chart

2012-09-26 Thread Pierre Haessig
Le 26/09/2012 15:25, Benjamin Root a écrit :

 Actually, if you are using the latest numpy (the 1.7 beta), that will
 also not work unless you are using py3k or did from __future__ import
 division.  Well, actually, using np.divide will always result in
 integer division (this may or may not be a bug).
Good point, I forgot I had set from __future__ import division some
months ago in my IPython startup settings.

So indeed, explicit casting to float is the safest approach.

Best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
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] synchronization of ticks position in twinx plots

2012-09-26 Thread Pierre Haessig
Le 26/09/2012 15:30, Benjamin Root a écrit :

 Probably could have the two axes listen for an xlim_changed event,
 check to see if it belongs to its twin, and update itself accordingly
 (without emitting).
I guess you mean ylim_changed event ?

(Maybe my description was not very clear, but the issue I'm having is
with respective placement of yticks on left and right sides.
xticks are the same, so no problem with these.)

Best,
Pierre



signature.asc
Description: OpenPGP digital signature
--
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