Re: [Matplotlib-users] Artifacts when saving as PDF

2015-04-12 Thread Jouni K Seppänen
Thanks for the report, I turned it into a github issue: 
https://github.com/matplotlib/matplotlib/issues/4331




--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] _backend_gdk.c:43:10: error: ‘PyArrayObject’ has no member named ‘strides’

2014-10-19 Thread Jouni K . Seppänen
Jouni K. Seppänen j...@iki.fi writes:

 I think there's clearly a bug in that review request. Does
 _backend_gdk.c not get compiled in tests?

 I have a proposed fix in branch fix-gdk-strides of

 https://github.com/jkseppan/matplotlib.git

 but I don't seem to have any systems with the prerequisites to compiling
 the gdk backend. Could someone who uses that backend try this out? It
 seems that drawing images or mathtext would exercise the code.

This was recently merged to master, together with another fix from
Michael Droettboom.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] _backend_gdk.c:43:10: error: ‘PyArrayObject’ has no member named ‘strides’

2014-10-17 Thread Jouni K . Seppänen
Thomas Caswell tcasw...@gmail.com
writes:

 What OS and what branch are you using?

 Can you roll back to one commit before the most recent merge?
 https://github.com/matplotlib/matplotlib/pull/3547 updated the numpy
 api.  If that fixes it, please make a new issue on github reporting
 the problem.

I think there's clearly a bug in that review request. Does
_backend_gdk.c not get compiled in tests?


-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] _backend_gdk.c:43:10: error: ‘PyArrayObject’ has no member named ‘strides’

2014-10-17 Thread Jouni K . Seppänen
Jouni K. Seppänen j...@iki.fi writes:

 Thomas Caswell tcasw...@gmail.com
 writes:

 What OS and what branch are you using?

 Can you roll back to one commit before the most recent merge?
 https://github.com/matplotlib/matplotlib/pull/3547 updated the numpy
 api.  If that fixes it, please make a new issue on github reporting
 the problem.

 I think there's clearly a bug in that review request. Does
 _backend_gdk.c not get compiled in tests?

I have a proposed fix in branch fix-gdk-strides of

https://github.com/jkseppan/matplotlib.git

but I don't seem to have any systems with the prerequisites to compiling
the gdk backend. Could someone who uses that backend try this out? It
seems that drawing images or mathtext would exercise the code.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Millions of data points saved to pdf

2014-05-02 Thread Jouni K . Seppänen
nertskull nertsk...@gmail.com writes:

 If I change that line the if True: then I get MUCH better results. 
 But I also get enormous file sizes.

That's interesting! It means that your pdf viewing program (which one,
by the way? Adobe Reader or some alternative?) is slow at compositing a
large number of prerendered markers, or perhaps it just renders each of
them again and again instead of prerendering, and does so more slowly
than if they were part of the same path.

 I've taken a subset of 10 of my 750 graphs.

 Those 10, before changing the backend, would make file sizes about about
 290KiB.  After changing the backend, if I use plot(x, y, '-') I still
 get a file size about 290KiB.

 But after changing the backend, if I use plot(x, y, '.') for my markers,
 my file size is no 21+ MB.  Just for 10 of my graphs.  I'm afraid making
 all 750 in the same pdf may be impossible at those size.

Does using ',' (comma) instead of '.' (full stop) as the marker help?  I
think the '.' marker is a circle, just at a small size, while the ','
marker is just two very short lines in the pdf backend. If the ','
marker produces an acceptable file size but its shape is not good
enough, we could experiment with creating a marker of intermediate
complexity.

One thing that I never thought about much is the precision in the
numbers the pdf backend outputs in the file. It seems that they are
being output with a fixed precision of ten digits after the decimal
point, which is probably overkill. There is currently no way to change
this except by editing the source code - the critical line is

r = (%.10f % obj).encode('ascii')

where 10 is the number of digits used. The same precision is used for
all floating-point numbers, including various transformation matrices,
so I can't offer a simple rule for how large deviations you will cause
by reducing the precision - you could experiment by making one figure
with the existing code and another with '%.3f', and see if the latter
looks good enough at the kind of zoom levels you are going to use (and
if it really reduces the file size much - there's a compression layer on
top of the ASCII representation).

That reminds me: one thing that could have an effect is the
pdf.compression setting, which defaults to 6 but you can set it to 9 
to make the compressed size a little bit smaller, at the expense of
spending more time when writing the file. That's not going to be a major
difference, though.

 Is there anyway to have reasonable pdf sizes as well as this improved
 performance for keeping them in vector format?

Like others have recommended, rendering huge clouds of single points is
a problematic task. I think it's an entirely valid thing to ask for, but
it's not likely that there will be a perfect solution, and some other
way of visualizing the data may be needed. Bokeh (suggested by Benjamin
Root) looks like something that could fit your needs better than a pdf
file in a viewer.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Millions of data points saved to pdf

2014-05-01 Thread Jouni K . Seppänen
nertskull nertsk...@gmail.com writes:

 The problem, is the pdf is unbearably slow when plotting as a scatter plot
 or as a line with markers.

 If I make a regular line plot, with no markers, just a single line, it is
 plotted and the pdf is fine.  But then it connects my points which I don't
 want.

Others have commented on the volume of data, but that paragraph makes
me curious: are you saying that the results are acceptable if you do
something like

  plot(x, y, '-')

but not if you do

  plot(x, y, 'o')  or  plot(x, y, '-o')?

The amount of data in the pdf file should be within a constant factor in
all cases, but the '-' case there are only moveto and lineto commands,
while the two other cases render markers as something called an XObject,
which is repeated a lot of times on the page. I wonder if the overhead
from using an XObject is making the rendering application slow.

Does it help at all to use a simpler marker, e.g. plot(x, y, ',')? One
change you could try if you're feeling adventurous is the following
function in lib/matplotlib/backends/backend_pdf.py:

def draw_markers(self, gc, marker_path, marker_trans, path, trans,
 rgbFace=None):
# For simple paths or small numbers of markers, don't bother
# making an XObject
if len(path) * len(marker_path) = 10:
RendererBase.draw_markers(self, gc, marker_path, marker_trans,
  path, trans, rgbFace)
return
# ...

The comment is not quite right: only if the path is short *and* the
number of markers is small does the XObject code get skipped. You could
just change the if statemt to if True: and rerun your code (possibly
with the ',' marker style). If that helps, it's evidence that we need to
revisit the condition for using XObjects for markers.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pdf File sizes on newer versions of matplotlib is a lot larger

2013-07-30 Thread Jouni K . Seppänen
Jeffrey Spencer jeffspenc...@gmail.com writes:

 I have three different versions of matplotlib that all output different
 file sizes with matplotlib 1.1.1 providing the smallest. This is for the
 same exact script. I can post the script if that helps.

 MPL 1.4.x: 539.32kb, Ubuntu 12.10
 MPL 1.1.1: 172.56kb Ubuntu 12.10
 MPL 1.2.1: 475.9kb, Ubuntu 13.04

Yes, it would be interesting to know what the plotting commands are.
Just as a guess, since all the sizes are a few hundred kilobytes, it
could be a difference in e.g. font embedding - many TrueType fonts are
of comparable size.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem saving open symbols in PDF

2012-10-18 Thread Jouni K . Seppänen
Benjamin Root ben.r...@ou.edu writes:

 On Wed, Oct 17, 2012 at 12:17 PM, Gökhan Sever
 gokhanse...@gmail.comwrote:

 Another point I noticed is setting linewidth to 0 (in fill_between
 function) isn't working as expected when figure is saved as a PDF file.

 Actually, this is not a bug in mpl.  It is a bug in various viewers.
 Some viewers have a minimum linewidth and will use that for any requested
 linewidths smaller than that.  Are you using Apple's Preview?

That's correct as per the pdf specification: a linewidth of zero means
the thinnest possible line on that device. That's why the pdf backend
attempts to not draw a line if the width is set to zero, but somehow
it's not working in this case. I'd call it a bug.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] Problem saving open symbols in PDF

2012-10-18 Thread Jouni K . Seppänen
Gökhan Sever gokhanse...@gmail.com
writes:

 Another point I noticed is setting linewidth to 0 (in fill_between
 function) isn't working as expected when figure is saved as a PDF
 file.

A workaround is to add edgecolor='None' to the fill_between call.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] Problem saving open symbols in PDF

2012-10-18 Thread Jouni K . Seppänen
Jouni K. Seppänen j...@iki.fi writes:

 Gökhan Sever gokhanse...@gmail.com
 writes:

 Another point I noticed is setting linewidth to 0 (in fill_between
 function) isn't working as expected when figure is saved as a PDF
 file.

 A workaround is to add edgecolor='None' to the fill_between call.

I filed an issue at https://github.com/matplotlib/matplotlib/issues/1412

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] static linking

2012-09-29 Thread Jouni K . Seppänen
Rita rmorgan...@gmail.com writes:

 i have a micro distribution setup. I am building python, numpy, scipy from
 scratch. I am building matplotlib from scratch also.

 I am doing a simple, /apps/bin/python setup.py build.

 I also compiled libpng and cairo in a location.

Have you set up pkg-config for your build of libpng? If you can't do
that for some reason, you can edit basedirlist in setup.cfg.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Font compatibility issue with Adobe Illustrator and MPL PDF's

2012-09-15 Thread Jouni K . Seppänen
florisvb flori...@gmail.com writes:

 I'm trying to get my pdf outputs from matplotlib to work properly in
 illustrator, but keep having the issue that illustrator does not recognize
 the computer modern fonts (eg. CMR10 etc). Everything else seems to work
 perfectly.

Is there any error message from illustrator? If you view the pdf file in
Acrobat Reader and choose the document information dialog, what type
does it list the CMR10 font as? I think this would usually be Type 1,
and there could be some problem with how Type-1 fonts get embedded.

 text.usetex: True

Do you need usetex or is matplotlib's built-in formula rendering
sufficient? In the latter case TrueType versions of the various fonts
are embedded, which just might work better than Type 1.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Accelerating PDF saved plots

2012-07-13 Thread Jouni K . Seppänen
Thanks for the explanation! Let's discuss further on that issue page.

Michiel de Hoon mjldeh...@yahoo.com writes:

 Hi Eric, Jouni,

 Thanks for your replies. I opened an issue here:

 https://github.com/matplotlib/matplotlib/issues/992

 and wrote an outline of how the PDF backend can be simplified by
 making use of gc.restore to keep track of the graphics context. In
 essence the PDF backend would then follow the same logic as the Cairo
 and Mac OS X backends, so it may be good to compare to these
 (especially the Cairo backend, since it's written in pure Python and
 easy to understand).

 Best,
 -Michiel.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] Accelerating PDF saved plots

2012-07-08 Thread Jouni K . Seppänen
Michiel de Hoon mjldeh...@yahoo.com writes:

 I think it is not so bad, since it's mainly a matter of removing the
 stuff from the PDF backend that is no longer needed. Do we have a
 maintainer for the PDF backend? Because I would rather rely on him/her
 to make the changes to this backend. 

That would be me. Can you outline what parts you think can be removed?

I'm currently travelling and don't always have an Internet connection,
or much time available, so turnaround can be slow.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] TeX + QT4Agg = Broken (Mac OS X)

2012-05-28 Thread Jouni K . Seppänen
Felix Patzelt fe...@neuro.uni-bremen.de writes:

 I just ran into the following Bug: When choosing Qt4Agg as my backend
 in the matplotlibrc, using TeX will break matplotlib. 

Could you run your test script with --verbose-debug, redirect the output
to a file and send it to me (off-list; it will be a large file)?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] TeX + QT4Agg = Broken (Mac OS X)

2012-05-28 Thread Jouni K . Seppänen
Jouni K. Seppänen j...@iki.fi writes:

 Felix Patzelt fe...@neuro.uni-bremen.de writes:

 I just ran into the following Bug: When choosing Qt4Agg as my backend
 in the matplotlibrc, using TeX will break matplotlib. 

 Could you run your test script with --verbose-debug, redirect the output
 to a file and send it to me (off-list; it will be a large file)?

Got it, thanks. This looks really odd: with both MacOSX and QT4Agg
backends, kpsewhich finds some TeX-related files, but with QT4Agg some
files are not found. It doesn't look like a simple matter of wrong paths
or anything like that, because then it would not find any files.

We have had multiple problems related to Qt and subprocesses. Some
Googling suggests that such problems are quite prevalent and might not
be easy to solve.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] TeX + QT4Agg = Broken (Mac OS X)

2012-05-28 Thread Jouni K . Seppänen
Felix Patzelt fe...@neuro.uni-bremen.de writes:

 Matplotlib-Version: 1.1.0

If that's the released version and not something from git, it does not
have one possibly related fix.  Could you try cherry-picking commit
09293bf from github, or applying the following patch.

commit 09293bf96f79f305d96ae4070dc89537efb9fb17
Author: Jouni K. Seppänen j...@iki.fi
Date:   Tue Dec 27 20:21:34 2011 +0200

Work around subprocess EINTR bug; fixes issue #633

The bug http://bugs.python.org/issue12493 is present in some Python
versions.

The _read_nointr function has been unused since b03a908 (it did
not work on Windows).

diff --git a/CHANGELOG b/CHANGELOG
index 9f5c700..e2a2b9d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+2011-12-27 Work around an EINTR bug in some versions of subprocess. - JKS
+
 2011-08-18 Change api of Axes.get_tightbbox and add an optional
keyword parameter *call_axes_locator*. - JJL
 
diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py
index 85fa70f..8a6dbd2 100644
--- a/lib/matplotlib/dviread.py
+++ b/lib/matplotlib/dviread.py
@@ -835,23 +835,17 @@ def find_tex_file(filename, format=None):
 
 matplotlib.verbose.report('find_tex_file(%s): %s' \
   % (filename,cmd), 'debug')
-pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+# stderr is unused, but reading it avoids a subprocess optimization
+# that breaks EINTR handling in some Python versions:
+# http://bugs.python.org/issue12493
+# https://github.com/matplotlib/matplotlib/issues/633
+pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+stderr=subprocess.PIPE)
 result = pipe.communicate()[0].rstrip()
 matplotlib.verbose.report('find_tex_file result: %s' % result,
   'debug')
 return result
 
-def _read_nointr(pipe, bufsize=-1):
-while True:
-try:
-return pipe.read(bufsize)
-except OSError, e:
-if e.errno == errno.EINTR:
-continue
-else:
-raise
-
-
 # With multiple text objects per figure (e.g. tick labels) we may end
 # up reading the same tfm and vf files many times, so we implement a
 # simple cache. TODO: is this worth making persistent?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks
--
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] corrupt pdf of histogram

2012-04-13 Thread Jouni K . Seppänen
Jouni K. Seppänen j...@iki.fi writes:

 I have a suggested fix for this at
 https://github.com/matplotlib/matplotlib/pull/817 

This is now merged into the v1.1.x branch, from which the fix should
propagate to the upcoming release.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] corrupt pdf of histogram

2012-04-09 Thread Jouni K . Seppänen
Benjamin Root ben.r...@ou.edu writes:

 sanders sand...@knmi.nl writes:

  If keywords fill=False and log=True,
 
  then after saving, the png looks fine but the histogram in the pdf is
  mixed up.

 Confirmed, thanks for the report. I filed this at
 https://github.com/matplotlib/matplotlib/issues/804

 I ran into something like this with filled plots originally saved as eps
 files and then converted into a pdf.  Didn't need log=True, though.  

I think that's likely a different issue. The eps output machinery in
matplotlib is somewhat complicated, which it likely has to be to
function well with various eps-handling software, and incorporate
LaTeX-rendered equations. With all the various steps (including
distilling through an external program) it's difficult to debug what
goes wrong.

In the original problem, it seems that the path-cropping functionality
used in logarithmic plots is outputting paths that work in Agg but not
in pdf or svg. It basically rewrites

  moveto X0,Y0 (outside plottable area)
  lineto X1,Y0 (outside plottable area)
  lineto X1,Y1 (inside)
  lineto X0,Y1 (inside)
  closepath

into

  moveto X0,Y0' (Y0' is Y0 rewritten to be close to the area)
  moveto X1,Y0'
  lineto X1,Y1
  lineto X0,Y1
  closepath

and the closepath operation apparently goes to the first moveto in Agg,
but to the latest moveto in pdf and svg.

I have a suggested fix for this at
https://github.com/matplotlib/matplotlib/pull/817 

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] corrupt pdf of histogram

2012-03-28 Thread Jouni K . Seppänen
sanders sand...@knmi.nl writes:

 If keywords fill=False and log=True,

 then after saving, the png looks fine but the histogram in the pdf is
 mixed up.

Confirmed, thanks for the report. I filed this at
https://github.com/matplotlib/matplotlib/issues/804

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error when saving as PDF using $\alpha$ and 'text.usetex':True

2012-03-08 Thread Jouni K . Seppänen
Alejandro Weinstein alejandro.weinst...@gmail.com writes:

 TypeError: unicode argument expected, got 'str'
 I am using MPL verion 1.2.x (built from commit 396a6446).

That reminds me of a problem fixed in commit 680edf7, so could you
either try cherry-picking that commit or updating to a later revision?
Your test case doesn't produce an error on a recent-ish master.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] pdf Output Failing

2012-02-24 Thread Jouni K . Seppänen
Sean Lake odysseus9...@gmail.com writes:

   File /sw/lib/python2.7/site-packages/matplotlib/dviread.py, line 727, in 
 _register
 assert encoding is None
 AssertionError

 Do I perhaps need to rebuild matplotlib because of a LaTeX update?

You'll need to do one of:

1. upgrade to matplotlib v1.1.0
2. apply the patch at https://github.com/matplotlib/matplotlib/commit/708c451
3. edit your pdftex.map file to not specify multiple encodings for one font;
   in one case, the culprit was URWBookmanL-DemiBold aka pbkdo8y

I recommend upgrading, but if you're comfortable editing TeX
configuration files, number 3 is the easiest workaround.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] Problems compiling matplotlib - png_info_def

2011-09-21 Thread Jouni K . Seppänen
Sarlo, Jeffrey S jsa...@central.uh.edu writes:

 libpng: 1.5.4

Your options are to use libpng 1.2.46, use a recent git version of
matplotlib, or cherry-pick commit 45c4667 on top of your older version
to get support for libpng 1.5. There is a new release planned soon, and
it will include this fix.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Details regarding TeX interpreter for different backends

2011-08-26 Thread Jouni K . Seppänen
Michael Droettboom md...@stsci.edu writes:

 The other approach is used when text.usetex is True.  It calls out
 to a real tex interpreter and then interprets the DVI it produces to
 convert it into a form the matplotlib backends can use.  Since I
 didn't write this code, I'm not as familiar with the details.

There are actually at least three mechanisms used by text.usetex:

(1) The Postscript backend uses psfrag. The Postscript file has
placeholders for LaTeX text, and the file is processed with LaTeX and
dvips to replace these placeholders with typeset text.

(2) The Agg backend puts each piece of TeX text into a separate file
(which you can find in ~/.matplotlib/tex.cache), processes it with LaTeX
into dvi and with dvipng into png, reads in the png files and overlays
them onto the image. (That's at least what I imagine it does; I have not
looked at the code.)

(3) The pdf backend uses the dviread module (written originally by me).
The various pieces of text are written into different tex files, just as
with the Agg backend, then processed with LaTeX into dvi files, which in
turn are translated by dviread into sequences of (x, y, font, character)
tuples. The dviread module reads the pdftex.map configuration file,
which maps the TeX font names into Postscript fonts, which are embedded
in the output PDF file, and the characters are placed at the coordinates
specified in the dvi file.

The dvipng approach avoids dealing with fonts, but the output is a
bitmap. With psfrag you can only get Postscript output (which is
nontrivial to parse), but it includes scalable fonts. The dviread
approach gets you both scalable fonts and the information of where each
character is, but you will have to deal with the fonts yourself. In PDF
output this is relatively easy, since we can piggyback on the pdftex.map
configuration file, which conveniently points to font files that can be
embedded in PDF.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-21 Thread Jouni K . Seppänen
Jeff Klukas klu...@wisc.edu writes:

   File 
 /Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py,
 line 727, in _register
 assert encoding is None
 AssertionError

This sounds like this issue:
https://github.com/matplotlib/matplotlib/issues/191

There is a workaround in git commit 708c451 (patch below), which you
could apply to your local copy of dviread.

diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py
index 5843a3c..7aca0ed 100644
--- a/lib/matplotlib/dviread.py
+++ b/lib/matplotlib/dviread.py
@@ -714,22 +714,30 @@ class PsfontsMap(object):
 subsetting, but I have no example of  in my TeX installation.
 
 texname, psname = words[:2]
-effects, encoding, filename = '', None, None
+effects, encodings, filename = '', [], None
 for word in words[2:]:
 if not word.startswith(''):
 effects = word
 else:
 word = word.lstrip('')
 if word.startswith('['):
-assert encoding is None
-encoding = word[1:]
+encodings.append(word[1:])
 elif word.endswith('.enc'):
-assert encoding is None
-encoding = word
+encodings.append(word)
 else:
 assert filename is None
 filename = word
 
+if len(encodings)  1:
+# TODO this is a stopgap workaround, need to handle this correctly
+matplotlib.verbose.report('Multiple encodings for %s = %s, skipping'
+  % (texname, psname), 'debug')
+return
+elif len(encodings) == 1:
+encoding, = encodings
+else:
+encoding = None
+
 eff = effects.split()
 effects = {}
 try:

-- 
Jouni K. Seppänen
http://www.iki.fi/jks
--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IOError: [Errno 4] Interrupted system call (Qt4 backend)

2011-08-21 Thread Jouni K . Seppänen
Tony Yu tsy...@gmail.com writes:

 IOError: [Errno 4] Interrupted system call

Sounds like http://bugs.python.org/issue1068268, which is supposed to
have been fixed. Which version of Python are you running?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help in solving a segfault problem?

2011-03-13 Thread Jouni K . Seppänen
Nicolas SCHEFFER scheffer.nico...@gmail.com writes:

 I didn't get much reply on this issue, so I'm just trying to resurrect
 the question.

Probably not many devs using Solaris, so no-one has been able to
reproduce this.

 #12 0xfd7ff4a22fd8 in py_to_agg_transformation_matrix
 (obj=0x774380, errors=value optimized out) at
 src/agg_py_transforms.cpp:22
 #13 0xfd7ff4a32e7c in _path_module::update_path_extents
 (this=value optimized out, args=...) at src/path.cpp:380

So it's in transforms-related code, but we can't see the locals. First
I'd try to recompile without optimizations and (hoping it still crashes)
inspect the local variables in these frames in gdb. Or maybe make the
functions print out their arguments and any other relevant locals.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem generating pdf file with LaTeX fonts

2011-03-13 Thread Jouni K . Seppänen
Pål Gunnar Ellingsen paa...@gmail.com writes:

 This is very strange I agree. I checked the pdftex.map file and it has
 changed due to me upgrading texlive 2011 during a normal fedora update some
 days ago. I've checked the log for the update, and the update contained a
 new updmap.cfg (which is the script for generating pdftex.map), which
 explains the difference in pdftex.map, though it does not help with solving
 the problem.

So it might be caused by updmap configuration. Are you able to compile
TeX source files that contain text in cmr12 using pdftex? E.g., put

\documentclass[12pt]{article}
\begin{document}
foo bar
\end{document}

in foo.tex and try pdflatex foo.tex. If you run into errors, or if the
output file has ugly bitmap Type-3 fonts like TeX-produced pdf files
used to have in the 1990s, it's clearly a bug in your TeX installation.
If not, it's more a problem in dviread's hijacking of pdftex.map for its
own purposes.

(Oh, I see that your problem is already fixed, but maybe future
searchers will benefit from this suggestion.)

 http://www.linux.cz/pipermail/texlive/2011-March/000105.html(removing
 texlive-amsfonts (without dependencies) and installing it again)
 I tried the solution used there, and it worked, meaning that pdftex.map now
 contains cmr12 and my test.py file runs properly and gives me a nice pdf
 file.

A simpler fix might have been sudo updmap-sys --enable MixedMap=cm.map.

 So again sorry for messing this up. I would like to thank you very much for
 your help.

No problem, and good that you got it sorted out!

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem generating pdf file with LaTeX fonts

2011-03-12 Thread Jouni K . Seppänen
Jouni K. Seppänen j...@iki.fi writes:

 Pål Gunnar Ellingsen paa...@gmail.com writes:

 I know there was a post on the mail liste a couple of days ago ( Bug
 in `dviread.py'), but I'm not sure if this is the same error, which it
 shouldn't be as I'm using the latest svn revision.

 Not the same error - it is showing a warning message generated by the
 workaround to that problem. It looks like your pdftex.map file is
 lacking an entry for cmr12, which doesn't make any sense.

Indeed your file does have the entry, and using your file on my computer
I cannot reproduce the problem. I pushed a branch on github that adds
some debugging information. Can you try the version of matplotlib that
you can get via the following commands (assuming you already have a
clone of the matplotlib main repository)?

git remote add jkseppan g...@github.com:jkseppan/matplotlib.git
git fetch jkseppan
git checkout jkseppan/dviread-bug

Alternatively, download the file

https://github.com/jkseppan/matplotlib/raw/dviread-bug/lib/matplotlib/dviread.py

and just copy it over your installed dviread.py file (make a backup
first).

Set verbose to debug-annoying and catch the output in a file; there will
be lots of it, so please email it to me off-list.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem generating pdf file with LaTeX fonts

2011-03-12 Thread Jouni K . Seppänen
Pål Gunnar Ellingsen paa...@gmail.com
writes:

 I only have a svn version of the repo, but I would like to move to git, but
 I get an error when running the code from
 http://matplotlib.sourceforge.net/devel/coding_guide.html#using-git

 git clone --origin svn g...@github.com:astraw/matplotlib.git

That's not the right address, and we should fix the instructions. 
Clone from the address

git://github.com/matplotlib/matplotlib.git

Also, my instructions earlier were wrong: all of the g...@github.com
addresses require an ssh key, but you can use

git remote add jkseppan git://github.com/jkseppan/matplotlib.git

to add my repository as a remote.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem generating pdf file with LaTeX fonts

2011-03-12 Thread Jouni K . Seppänen
Jouni K. Seppänen j...@iki.fi writes:

 Set verbose to debug-annoying and catch the output in a file; there will
 be lots of it, so please email it to me off-list.

Got it, thanks. Unfortunately I have no idea what's going on. The debug
information indicates that the PsfontsMap._register function (which only
gets called from within the loop in PsfontsMap._parse) is called with
pdftex.map lines out of order, and lacking some of the lines.

The pdftex.map file you sent me starts with some comments followed by
these entries:

ASCII ASCII ASCII.pfb
Acorn AcornInitials Acorn.pfb
AlphaDia ChessAlphaDiagram AlphaDia.pfb
AmiciLogo AmiciLogo AmiciLogo.pfb

The log messages, on the other hand, start like this:

PsfontsMap: register ['Acorn', 'AcornInitials', 'Acorn.pfb']
PsfontsMap: register ['aealbattar', 'ae_AlBattar', 'ArabeyesArabicEncoding 
ReEncodeFont', 'ararabeyes.enc', 'ae_albattar.pfb']
PsfontsMap: register ['aealmateen', 'ae_AlMateen', 'ArabeyesArabicEncoding 
ReEncodeFont', 'ararabeyes.enc', 'ae_almateen.pfb']

Here's a small table. The first column is just line numbers within that
part of the debug log, the second is the number of the entry in
pdftex.map referenced, the third is the first word of that entry:

1 2 Acorn
2 279 aealbattar
3 280 aealmateen
4 281 aealmohanadb
5 282 aealmohanadbolditalic
6 278 ae_almohanad_xxbold
7 283 aealmothnna
8 284 aealyermook
9 285 aearab

So it first gets entry #2 (Acorn) from the file, then jumps to entry
#279 (aealbattar) and starts going forward from there, except #278 gets
between #282 and #283. It goes on like this for a while, then:

32 308 aetarablus
33 309 aetholoth
34 3 AlphaDia
35 4 AmiciLogo
36 5 AmiciLogoBold
37 6 AmiciLogoBoldRslant
38 7 AmiciLogoBoldSlant
39 8 AmiciLogoRslant
40 9 AmiciLogoSlant
41 310 andlso
42 10 AnnSton
43 311 aram10

So after #309 it jumps back to #3 for a while, etc., and the critical
font cmr12 is skipped altogether.

Hmm. The ordering is almost consistent with sorting the font names
case-insensitively, but that wouldn't explain the missing fonts.

Could you double-check that you sent me the correct pdftex.map file?
Run on the system where you have this problem e.g. the following
commands:

kpsewhich pdftex.map
head `kpsewhich pdftex.map`

and check that ASCII, Acorn, and AlphaDia are the first three
non-comment entries.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] bins and histograms

2011-03-10 Thread Jouni K . Seppänen
Andrea Crotti andrea.crott...@gmail.com writes:

 values = { (0,10) : 0.5,
   (10, 20) : 0.3 }
 and so on, where the key is a time slot interval and the value is the
 value I want to plot.

 What should be the correct way to get what I want?

Something like this perhaps:

left, width = zip(*[(a, b-a) for (a,b) in values.keys()])
bar(left, values.values(), width)

That is, turn the sequence of intervals into a sequence of coordinates
where the bars should start (left) and another sequence of bar widths.
Then use bar to plot the values.

 In theory the data that I want to plot is [0.5, 0.3]
 but if I do

 plt.hist(values.values())

The hist function not only plots the histogram bars but computes them
from the data. Use bar when you already have the coordinates you want to
plot.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem generating pdf file with LaTeX fonts

2011-03-08 Thread Jouni K . Seppänen
Pål Gunnar Ellingsen paa...@gmail.com writes:

 I know there was a post on the mail liste a couple of days ago ( Bug
 in `dviread.py'), but I'm not sure if this is the same error, which it
 shouldn't be as I'm using the latest svn revision.

Not the same error - it is showing a warning message generated by the
workaround to that problem. It looks like your pdftex.map file is
lacking an entry for cmr12, which doesn't make any sense. I installed
TeX Live 2010 on my Mac, and I don't see this problem. Can you send me
your pdftex.map file off-list? It seems to be at

/usr/share/texlive/texmf-var/fonts/map/pdftex/updmap/pdftex.map

on your system.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cannot print out .eps figures

2011-03-02 Thread Jouni K . Seppänen
Zhaoru Zhang zhaoruzh...@gmail.com writes:

 I created an eps figure file with matplotlib. I can look at it via mac
 preview, but when I inserted it into a word document and printed it
 out, I got nothing except for the eps file information.

It's a long time since I tried using eps files in Word, but I think it
used to only work if you print to a PostScript printer. Does pdf work
better?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Free Software Download: Index, Search  Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in `dviread.py'

2011-02-27 Thread Jouni K . Seppänen
Jouni Seppänen j...@iki.fi writes:

 pbkdo8y URWBookmanL-DemiBold .167 SlantFont TeXnANSIEncoding ReEncodeFont 
 texnansi.enc 8r.enc ubkd8a.pfb

 I guess we will need to implement slightly more of a PostScript
 interpreter inside matplotlib to figure out which file is to be used
 for re-encoding the font, unless this really means some kind of a
 combination of the two encodings. I'll try to find out what pdftex
 does with this.

The author of pdftex reports that pdftex just takes the last encoding
file specified (so this font probably gets encoded wrong):

http://thread.gmane.org/gmane.comp.tex.pdftex/4913/focus=4914

This is very likely a bug in TeX Live, or whatever software caused that
line to be added to the pdftex.map file.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Free Software Download: Index, Search  Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in `dviread.py'

2011-02-07 Thread Jouni K . Seppänen
Michael Anselmi selmo2...@gmail.com writes:

 When trying to save a matplotlib figure as a PDF with `text.usetex =
 True' in `matplotlibrc', at some point the `PsfontsMap' function in
 `dviread.py' attempts to parse TeX Live 2010's `pdftex.map' file and
 fails.

Can you send me the pdftex.map file off-list?

Thanks for the bug report,
-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in `dviread.py'

2011-02-07 Thread Jouni K . Seppänen
Jouni Seppänen j...@iki.fi writes:

 I filed this in the bug tracker: 
 https://sourceforge.net/tracker/?func=detailaid=3175113group_id=80706atid=560720

I installed TeX Live 2010 on my Mac in order to test this, but
mysteriously, the pdftex.map file does not have a line for pbkdo8y. The
closest match is

pbkdo8r URWBookmanL-DemiBold .167 SlantFont TeXBase1Encoding ReEncodeFont 
8r.enc ubkd8a.pfb

which is the same font but with another encoding. I wonder if this
indicates a problem in the way Ubuntu sets up TeX Live?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in `dviread.py'

2011-02-07 Thread Jouni K . Seppänen
Jouni Seppänen j...@iki.fi writes:

In the meantime, I will commit a quick workaround that just disables
the fonts we can't handle instead of aborting with an assert.

Now committed in revision 8955 (1.0 maintenance branch) and 8956
(svn trunk). Please test on your system.

Index: lib/matplotlib/dviread.py
===
--- lib/matplotlib/dviread.py	(revision 8954)
+++ lib/matplotlib/dviread.py	(revision 8955)
@@ -714,22 +714,30 @@
 subsetting, but I have no example of  in my TeX installation.
 
 texname, psname = words[:2]
-effects, encoding, filename = '', None, None
+effects, encodings, filename = '', [], None
 for word in words[2:]:
 if not word.startswith(''):
 effects = word
 else:
 word = word.lstrip('')
 if word.startswith('['):
-assert encoding is None
-encoding = word[1:]
+encodings.append(word[1:])
 elif word.endswith('.enc'):
-assert encoding is None
-encoding = word
+encodings.append(word)
 else:
 assert filename is None
 filename = word
 
+if len(encodings)  1:
+# TODO this is a stopgap workaround, need to handle this correctly
+matplotlib.verbose.report('Multiple encodings for %s = %s, skipping'
+  % (texname, psname), 'debug')
+return
+elif len(encodings) == 1:
+encoding, = encodings
+else:
+encoding = None
+
 eff = effects.split()
 effects = {}
 try:

-- 
Jouni K. Seppänen
http://www.iki.fi/jks
--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Latex text rendering

2010-11-24 Thread Jouni K . Seppänen
David Pine d...@nyu.edu writes:

 name 'xpdf' is not defined

 params = {'backend': 'Agg',
 ...
   'ps.usedistiller' : xpdf,

Put xpdf in quotes: 'xpdf' not xpdf. In the matplotlibrc file you don't
need quotes there, but if you use Python to set parameters, you do.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] dolphin save as svg broken

2010-10-13 Thread Jouni K . Seppänen
Carl Karsten c...@personnelware.com writes:

 Need to get 535MB of archives.

 The following NEW packages will be installed:
[...]
   texlive-doc-base texlive-extra-utils texlive-font-utils

It seems to be pulling in all of TeX Live, which is huge and by no means
necessary to run matplotlib. Matplotlib can pass strings through TeX for
formatting (the usetex option) but doesn't do that by default.

Oh, it's build-dep... I guess you need TeX to build the manual, but I
don't think it is needed to get the library itself working.

Is there a way to ask apt what the build dependencies for a package are,
and then install only a subset?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2  L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] user group video

2010-10-13 Thread Jouni K . Seppänen
Carl Karsten c...@personnelware.com writes:

 Anyone know if this message is archived somewhere:
 Jeez, you guys have some crazy examples. I am surprised there isn't
 dolphins swimming around inside a sphere.

You probably mean this one:

http://article.gmane.org/gmane.comp.python.matplotlib.general/13648

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2  L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-04 Thread Jouni K . Seppänen
Michael Droettboom md...@stsci.edu writes:

 On 10/02/2010 01:39 PM, Jouni K. Seppänen wrote:
 Benjamin Rootben.r...@ou.edu  writes:


 And yet, we still allow for saving to jpegs.
  
 Wow, I didn't know. Last time I tried that I got a traceback, and
 assumed that it was not supported exactly because jpeg is a nonsensical
 format for most graphs.

 I just tried again, and got TypeError: 'int' object is unsubscriptable
 from PIL/JpegImagePlugin.pyc in _save(im, fp, filename). I suppose this
 doesn't get much testing.

 Aside from the question of whether we should support JPEGs, etc., that 
 code path should work (and in fact it does on my machine).  What version 
 of PIL do you have installed, and can you provide the full traceback 
 here?  

It seems that I have an egg install of version 1.1.6., and here's a
traceback:

Traceback (most recent call last):
  File stdin, line 1, in module
  File /Users/jks/Hacking/mpl/git/lib/matplotlib/pyplot.py, line 363, in 
savefig
return fig.savefig(*args, **kwargs)
  File /Users/jks/Hacking/mpl/git/lib/matplotlib/figure.py, line 1160, in 
savefig
self.canvas.print_figure(*args, **kwargs)
  File /Users/jks/Hacking/mpl/git/lib/matplotlib/backend_bases.py, line 1961, 
in print_figure
**kwargs)
  File /Users/jks/Hacking/mpl/git/lib/matplotlib/backend_bases.py, line 1787, 
in print_jpg
return image.save(filename_or_obj, **kwargs)
  File /Library/Python/2.6/site-packages/PIL/Image.py, line 1405, in save
save_handler(self, fp, filename)
  File /Library/Python/2.6/site-packages/PIL/JpegImagePlugin.py, line 406, in 
_save
dpi[0], dpi[1]
TypeError: 'int' object is unsubscriptable

It looks like something is now passing a dpi keyword argument to
print_jpg, but something inside PIL is expecting its value to be a
sequence. I'll commit a fix.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] unicode minus sign glyph missing with serif fonts in macosx backend

2010-10-04 Thread Jouni K . Seppänen
Joey Richards j...@caltech.edu writes:

 When I plot with the MacOSX backend using a serif font, the negative
 signs on the axis labels show up as the missing glyph open squares
 rather than minus signs.

 I am using matplotlib 1.0 installed from the dmg file for Python 2.6
 on OSX 10.6.  I'm using Python 2.6.6 installed from the python.org
 binary distribution.

FWIW, I can't reproduce this on OS X 10.6.4, system Python 2.6.1,
self-compiled trunk matplotlib, tried Vera and Times New Roman.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] unicode minus sign glyph missing with serif fonts in macosx backend

2010-10-04 Thread Jouni K . Seppänen
Joey Richards j...@caltech.edu writes:

 The system-installed fonts all should have the minus sign, though I
 don't know for sure which fonts matplotlib is using.

You can find out with dtrace: start up python as usual but don't plot
anything yet, then in another terminal type ps a to find out the PID
of the process and trace it with dtruss:

sudo dtruss -p 29611 | grep Fonts

Here 29611 is the PID. When you plot something, you should see the
process access some files, e.g.

open(/Library/Fonts/Times New Roman.ttf\0, 0x0, 0x0)   = 12 0

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] unicode minus sign glyph missing with serif fonts in macosx backend

2010-10-04 Thread Jouni K . Seppänen
Tony S Yu tsy...@gmail.com writes:

 This is probably unrelated, but I can't even use serif fonts on the
 MacOSX backend (it just shows up as sans-serif). I tried Times New
 Roman, Vera, and a Computer Modern unicode font that I normally use).

I noticed that I didn't really get Vera either, probably because I don't
have it installed via the usual OS X way, and the MacOSX backend only
uses fonts that it can find via CTFontCreateWithName or
ATSFontFindFromPostScriptName, depending on the OS X version it's
compiled for. Do you see these fonts in Font Book?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Jouni K . Seppänen
Nils Wagner nwag...@iam.uni-stuttgart.de writes:

 just curious - is the WebP format supported by matplotlib 

No. It seems to be a method for lossy compression of photographs and
therefore not likely to be useful for line drawings - or what did you
have in mind?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Jouni K . Seppänen
Benjamin Root ben.r...@ou.edu writes:

 And yet, we still allow for saving to jpegs.

Wow, I didn't know. Last time I tried that I got a traceback, and
assumed that it was not supported exactly because jpeg is a nonsensical
format for most graphs.

I just tried again, and got TypeError: 'int' object is unsubscriptable
from PIL/JpegImagePlugin.pyc in _save(im, fp, filename). I suppose this
doesn't get much testing.

 Also, matplotlib is also able to do imshow(), pcolor() and other
 rasterized drawings, so we aren't restricted to just line drawings.

Yes, I guess there are some circumstances in which this would make
sense. Would supporting WebP require new library dependencies?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] asynchronous plots?

2010-09-25 Thread Jouni K . Seppänen
John Salvatier jsalv...@u.washington.edu writes:

 Is there a way to do asynchronous plots in matplotlib? By asynchronous I
 mean plots that simply spawn a new process and do not stop the program while
 the plot is visible? 

In 2007 Bill Baxter made a package called ezplot that does plots in a
separate process via a remote procedure call interface. I don't think
the project has been continued since, so it might not be compatible with
current matplotlib, but it may be a useful starting point:

http://www.billbaxter.com/projects/ezplot/

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] legend and bbox_to_anchor, and draggable()

2010-09-25 Thread Jouni K . Seppänen
Daniel Hyams dhy...@gmail.com writes:

 I was playing around with draggable legends, and some strange things started
 happening (exception down in the depths of beckend_agg.py, accompanied by a
 long stack trace).  To make a long story short, I can reproduce this in the
 draggable_legend.py example on the matplotlib website.  All you have to do
 is change line 7 [...] to

 l = ax.legend(bbox_to_anchor=(.1,.1))

Apparently this creates a bounding box with zero width and height, which
causes NaNs to appear in various transforms later on. It seems that you
can get the same placement of the legend with

l = ax.legend(bbox_to_anchor=(0,0,.1,.1))

which creates a non-degenerate bounding box that doesn't have this
problem. A possibly simpler option is

l = ax.legend(loc=(-0.2,0.1))

which sets the position of the lower-left corner of the legend box so
you'll need to tweak the coordinates from what you used with
bbox_to_anchor.

 I'm sure that I'm not understanding the proper usage of
 bbox_to_anchor.  

I'm not sure either. It seems that the two-number form of the bounding
box is meant to create a degenerate bounding box so that any kind of
location specifier (upper right, lower center, etc) will always hit
that exact place, but perhaps naturally that makes it difficult to move
the box around.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] convert figure from color to BW/grayscale

2010-09-20 Thread Jouni K . Seppänen
Eli Brosh ebro...@gmail.com writes:

 I need to prepare two versions of figures: color and BW(BlackWhite).
 Is there an easy way to produce just the colored version and than use some
 command or script to turn it to BW or grayscale?

For some really simple plots, and for pdf output only, you can try

rc('pdf', inheritcolor=True)

This produces a (possibly invalid) PDF file that doesn't set any colors,
and will usually be rendered in black on white. I implemented this in
response to a request to be able to inherit the current foreground color
in pdfLaTeX: if you set the color to e.g. red and include such a file,
it will be rendered in red.

This was quite some time ago, and matplotlib now has more drawing
primitives, not all of which work sensibly with this option. In some
examples you get all-black images, in some you get color in one part of
the image. But I guess this option only ever made sense for pretty
simple line drawings.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Scale legend box border, dashed and dotted lines when the figure size is changed

2010-07-10 Thread Jouni K . Seppänen
Janne Blomqvist blomqvist.ja...@gmail.com writes:

 The problem I'm having is that as the figure is then pretty small, I
 can scale font sizes, axis sizes, line widths etc., but what I've been
 unable to figure out is how to scale dashed or dotted lines, as well
 as the thickness of the legend border box. 

It seems that there are no rc settings for these, but you can adjust
them as follows:

 a.plot(x, y, '--', label='foo bar')

Change this to 

  a.plot(x, y, '--', label='foo bar', dashes=(2,2))

The value of dashes is the number of points of ink followed by the
number of points of whitespace. It defaults to (6,6) for the '--'
linestyle (found in the dashd dictionary of backend_bases.py).

 a.legend()

Change this to

  lg = a.legend()
  fr = lg.get_frame()
  fr.set_lw(0.2)

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib import problem

2010-05-05 Thread Jouni K . Seppänen
ailp...@gmail.com ailp...@gmail.com writes:

 I have strange problem while I am importing matplotlib.

   File /usr/lib/python2.6/xml/sax/saxutils.py, line 6, in module
 import os, urlparse, urllib, types
   File /usr/lib/python2.6/urllib.py, line 26, in module
 import socket
   File socket.py, line 7, in module
 except socket.error:
 AttributeError: 'module' object has no attribute 'error'

Note how Python prints the full path of saxutils.py and urllib.py but a
bare filename for socket.py. You probably have a file named socket.py in
your current working directory that is inadvertently getting imported by
urllib.py.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


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


Re: [Matplotlib-users] Possible bug with contour, alpha blending and vector output

2010-01-30 Thread Jouni K . Seppänen
Moving to the devel list, since this concerns an internal API of
matplotlib. Thanks to Sourav for reporting this and to Eric for sending
the note to me.

Eric Firing efir...@hawaii.edu writes:

 Sourav K. Mandal wrote:
 I have a simple problem: when outputting to PDF or SVG, alpha blending
 does not work for the lines drawn by contour.  However, alpha blending
 does work for the regions given by contourf.  

 You are right, this is a real bug, verified in svn.  

The contour function creates a LineCollection, which gets drawn via
draw_path_collection, which the pdf backend inherits from backend_bases.
The default draw_path_collection (or _iter_collection really)
communicates the alpha of the *face color* only by setting the alpha
attribute of the GraphicsContext:

if rgbFace is not None and len(rgbFace)==4:
gc0.set_alpha(rgbFace[-1])
rgbFace = rgbFace[:3]

The alpha of the line only gets communicated via the fourth component of
the rgb attribute of the GraphicsContext, and currently the pdf backend
doesn't do anything with it.

I think this could be resolved in a number of ways, none of which is
obviously the perfect solution:

1. Add a check in _iter_collection for gc0._rgb having an alpha
   component, similar to the current check for rgbFace, and set the
   alpha attribute from that one too. (What if both rgbFace and gc0._rgb
   have an alpha component?)

2. Make each backend's GraphicsContext set the alpha attribute from the
   color. (If the alpha attribute is already set, how should they be
   combined? Multiply, take the minimum, or what?)

3. Either get rid of the alpha attribute on the GraphicsContext and use
   only rgba tuples within backends, or turn it into two attributes
   (e.g. alphaFace and alphaStroke). (What to do with the frontend's
   single alpha attribute?)

By the way, I have never really understood why rgbFace is given
separately from the GraphicsContext. Is this just an evolutionary
remnant or is there a deeper meaning for it?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


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


Re: [Matplotlib-users] Problem generating postscript

2009-12-31 Thread Jouni K . Seppänen
Eric Emsellem eemse...@eso.org writes:

 regarding my last post, I still have pb generating simple eps files.

Can you be more specific about the last post you are referring to? I
searched using Gmane and didn't find anything recent:

http://search.gmane.org/?author=eric+emsellemgroup=gmane.comp.python.matplotlib.generalsort=date

 thanks a lot for the quick tip. But no xpdf does not do it (I had
 tried it).

What exact error message do you get in that case?

 ps.usedistiller   : None
 ## I tried all possible distiller... didn't change the pb.

Certainly the error message must have changed between runs, since your
first post showed a Ghostscript-specific message.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-03 Thread Jouni K . Seppänen
Matthias Michler matthiasmich...@gmx.net writes:

 Do you know why is happens only for  ps/eps-files?

The ps backend uses TeX in a different way than the other backends. It
uses psfrag and dvips to construct the final file.

 Have you set any TeX-related environment variables or edited any
 configuration files? What does kpsepath tex print?

 in my .zshrc I set
 TEXINPUTS=~/Texte/Styles//:.//:

It's probably the .// entry, which causes TeX to search all
subdirectories of the current directory. The ps backend does something
like

cd /tmp  latex file.tex

so it should just look in subdirectories of the temporary directory, but
perhaps it somehow goes awry. Do you have some setting that causes
temporary files to end up in the root directory?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-02 Thread Jouni K . Seppänen
Matthias Michler matthiasmich...@gmx.net writes:

 ./root/article.cls.tex: Permission denied
 ./root/article.cls: Permission denied
 ./lost+found/article.cls.tex: Permission denied
 ./lost+found/article.cls: Permission denied
 ./root/article.cls.tex: Permission denied
 ./root/article.cls: Permission denied
 ./lost+found/article.cls.tex: Permission denied
 ./lost+found/article.cls: Permission denied

That looks like a TeX configuration problem. I'm guessing that when TeX
encounters \documentclass{article}, it asks the path-searching library
for article.cls, and for some reason /root and /lost+found are
included in the path. You don't have permission as normal user to access
these directories, so the library causes error messages to be printed.
The path probably also includes the correct directories, so the search
eventually succeeds, but then article.cls wants to input size10.clo,
causing a new round of errors:

 ./root/size10.clo.tex: Permission denied
 ./root/size10.clo: Permission denied
(etc)

Have you set any TeX-related environment variables or edited any
configuration files? What does kpsepath tex print?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Links in pdf

2009-11-30 Thread Jouni K . Seppänen
Michael Droettboom md...@stsci.edu writes:

 Just a note when implementing this feature (I'm too busy at the moment 
 as well) -- the SVG backend already supports hyperlinks, so if possible 
 the PDF support should piggyback on its public API (get_url/set_url).

Yes, for URL links the API should look similar, but I think for
multimedia we need a richer API. PDF has support for embedding sound
files in various formats since version 1.2, and (very complicated
looking) support for general multimedia since version 1.5.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Links in pdf

2009-11-28 Thread Jouni K . Seppänen
Fabricio Silva si...@lma.cnrs-mrs.fr writes:

 I wish I could save include links in exported pdf file. Tell me whether
 it is possible to have a pdf file containing matplotlib plots on which I
 could click to run actions, in the same manner that pdf files can
 include clickable URL...

This is not possible with the current pdf backend. I imagine it would
not be too difficult to implement, but I am way too busy at work to do
it any time soon.

 More specifically, I have a figure with a bunch of nicely-formatted
 subplots and I embed this figure in a beamer presentation. I wish I
 could play the associated sound when I click on one of the subplots in
 Beamer (running a shell command).

Beamer comes with a package called multimedia, and I think it allows you
to achieve something much like this -- see the \sound and
\hyperlinksound macros. It might be difficult to make the hyperlink be
exactly some subplot, but perhaps you could use e.g. speaker icons as
link anchors and place them in suitable locations.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] metadata

2009-11-13 Thread Jouni K . Seppänen
Marius Jan Klein mjk...@nyu.edu writes:

 I want to edit the metadata of pdf- or png-files when creating one of
 these files. I do not want to use for example Pypdf because then
 Python must read the file first before it can be edited.

Concerning pdf files, there is no current support for that, but at least
the simplest form of metadata could be supported pretty easily (the
document information dictionary - title, author, subject, keywords,
creator, producer, creation date, modification date). What sort of API
do you have in mind?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] metadata

2009-11-13 Thread Jouni K . Seppänen
Jouni K. Seppänen j...@iki.fi writes:

 Marius Jan Klein mjk...@nyu.edu writes:

 I want to edit the metadata of pdf- or png-files when creating one of
 these files. I do not want to use for example Pypdf because then
 Python must read the file first before it can be edited.

 Concerning pdf files, there is no current support for that, 

Now there is (in the trunk, revision 7964), via the PdfPages mechanism:

from matplotlib.backends.backend_pdf import PdfPages
from pylab import *
pdf = PdfPages('testing.pdf')
plot([3,1,4])
pdf.savefig()
d = pdf.infodict()
d['Title'] = 'Testing'
d['Author'] = u'Jouni K. Sepp\xe4nen'
pdf.close()

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib with Qt4 backend

2009-11-12 Thread Jouni K . Seppänen
Celil Rufat celil.ru...@gmail.com writes:

 However, when I try one of the Qt4 examles:
[...]
   File
 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py,
 line 303, in get_fontconfig_fonts
 status, output = commands.getstatusoutput(fc-list file)
   File
 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/commands.py,
 line 56, in getstatusoutput
 text = pipe.read()
 IOError: [Errno 4] Interrupted system call

I believe the attached patch (already committed to the trunk) should fix
this on Python 2.6, but I don't have a Qt installation to try it out
with. Can you try this on your system?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks

Index: lib/matplotlib/font_manager.py
===
--- lib/matplotlib/font_manager.py	(revision 7951)
+++ lib/matplotlib/font_manager.py	(working copy)
@@ -42,7 +42,7 @@
 see license/LICENSE_TTFQUERY.
 
 
-import os, sys, glob
+import os, sys, glob, subprocess
 try:
 set
 except NameError:
@@ -292,16 +292,12 @@
 grab all of the fonts the user wants to be made available to
 applications, without needing knowing where all of them reside.
 
-try:
-import commands
-except ImportError:
-return {}
-
 fontext = get_fontext_synonyms(fontext)
 
 fontfiles = {}
-status, output = commands.getstatusoutput(fc-list file)
-if status == 0:
+pipe = subprocess.Popen(['fc-list', '', 'file'], stdout=subprocess.PIPE)
+output = pipe.communicate()[0]
+if pipe.returncode == 0:
 for line in output.split('\n'):
 fname = line.split(':')[0]
 if (os.path.splitext(fname)[1][1:] in fontext and
@@ -1244,11 +1240,11 @@
 import re
 
 def fc_match(pattern, fontext):
-import commands
 fontexts = get_fontext_synonyms(fontext)
 ext = . + fontext
-status, output = commands.getstatusoutput('fc-match -sv %s' % pattern)
-if status == 0:
+pipe = subprocess.Popen(['fc-match', '-sv', pattern], stdout=subprocess.PIPE)
+output = pipe.communicate()[0]
+if pipe.returncode == 0:
 for match in _fc_match_regex.finditer(output):
 file = match.group(1)
 if os.path.splitext(file)[1][1:] in fontexts:
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Source tarball should not include setup.cfg (was: 0.99.1.1 build attempts to import non-existing wx)

2009-10-28 Thread Jouni K . Seppänen
Erin Sheldon erin.shel...@gmail.com writes:

 I just downloaded 0.99.1.1 and I'm finding this error:

   wxPython: no
 * wxPython not found
 Traceback (most recent call last):
   File setup.py, line 146, in module
 import wx
 ImportError: No module named wx

This is because the distribution includes a setup.cfg file by mistake.
Deleting setup.cfg should allow the autodetection logic to disable
building wxagg. This is bug #2871530 on Sourceforge:

https://sourceforge.net/tracker/?func=detailaid=2871530group_id=80706atid=560720

I suggest we release a 0.99.1.2, possibly with just this bug fixed,
since this problem keeps being reported on the mailing lists.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib setup is trying to build macosx extension on linux ?

2009-10-14 Thread Jouni K . Seppänen
David Cournapeau da...@ar.media.kyoto-u.ac.jp writes:

 This would always build the mac os x extension if
 options['build_macosx'] is True, which is  the case for me (it is set-up
 in setup.cfg, which I did not touch).

The setup.cfg file is included in the distribution by mistake. Just
delete it before building.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread Jouni K . Seppänen
phob...@geosyntec.com writes:

 |C:\Documents and Settings\phobsonipython26 -pylab

Could you try this in plain Python? I'm asking because you seem to be
getting an IPython warning about a possibly corrupted traceback:

 ERROR: An unexpected error occurred while tokenizing input
 The following traceback may be corrupted or invalid
 The error message is: ('EOF in multi-line statement', (550, 0))

I suggest you write your commands in a script and run it with 

python script.py --verbose-debug

so that we can get a better picture of where it is going wrong.

Also, does it matter that you are using Qt4Agg? You can test this by
trying

python script.py -d pdf --verbose-debug

If that works, then the problem could be related to Qt4Agg specifically,
but if it fails, it is somewhere else.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread Jouni K . Seppänen
phob...@geosyntec.com writes:

   File C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py, 
 line 1378, in draw_mathtext
 self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
 ValueError: unichr() arg not in range(0x1) (narrow Python build)

Right, IPython really had mangled the traceback. That looks like the
mathtext parser is outputting some characters outside the Basic
Multilingual Plane. Could you try the following:

python -i c:\GDAG2009\python\pyTest.py -d pdf

Then when the error occurs, you should be at a Python prompt. Then type
(or just copy and paste from here - be careful with the first two lines,
since any exception will cause Python to forget the existing traceback):

from pdb import pm
pm()
p fontname, fontsize, num, symbol_name
p s, width, height, descent, glyphs, rects, used_characters
p fonttype, global_fonttype

It might work to set pdf.fonttype to 3 in matplotlibrc, but even if it
helps, it would be useful to find the root of this problem.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problems with MPLCONFIGDIR

2009-10-09 Thread Jouni K . Seppänen
Luis Omar Barbosa García ion...@gmail.com writes:

 RuntimeError: '/home/ionek' is not a writable dir; you must set
 /home/ionek/.matplotlib to be a writable dir.  You can also set
 environment variable MPLCONFIGDIR to any writable directory where you
 want matplotlib data stored

Sounds like you have a problem with the permissions on your home
directory. Can you create the directory ~/.matplotlib yourself and make
it writable by yourself? The commands to do that would be something like

mkdir ~/.matplotlib
chmod u+w ~/.matplotlib

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TeX and lucidabr

2009-09-30 Thread Jouni K . Seppänen
Marco Cabizza marc...@gmail.com writes:

   The point is that when i put \usepackage{lucidabr} it complains about  
 a missing \begin{document}. Does the text.latex.preamble variable  
 replace the whole LaTeX preamble ?

No, it shouldn't do that. Run rm ~/.matplotlibrc/tex.cache/*, then run
your script once, and take a look at the tex file created in the
tex.cache directory. Can LaTeX compile it directly?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TeX and lucidabr

2009-09-30 Thread Jouni K . Seppänen
Marco Cabizza marc...@gmail.com writes:

 \
 u
 s
 e

Sounds like the value of your text.latex.preamble got interpreted as a
list of one-character strings and not a list of one longer string. What
exactly do you have in the rc file as the contents of tex.latex.*
variables in the file? What does 

matplotlib.rcParams['text.latex.preamble']

return? If you do

matplotlib.rcParams['text.latex.preamble'] = [r'\usepackage{lucidabr}']

does it start working?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib with eclipse: how to get a graph?

2009-09-22 Thread Jouni K . Seppänen
Mark Bakker mark...@gmail.com writes:

 I recently started using Eclipse with Pydev. I like it a lot but have not
 been able to get interactive plotting going (which otherwise works
 fine).

Does Pydev have any sort of specific support for matplotlib? I'm asking
because even in the normal Python shell interactive work can be
difficult, depending on the backend, and whatever command-loop magic
IPython does makes it work better. You could try different backends, but
I suspect that Pydev would have to have specific support for integrating
the backend-specific command loop for it to really work.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] DeprecationWarning

2009-09-17 Thread Jouni K . Seppänen
Nils Wagner nwag...@iam.uni-stuttgart.de writes:

 Is it possible to suppress the output of 
 DeprecationWarning messages on the screen ?

Run python with the -Wignore::DeprecationWarning option; see the manual
page for details.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Strange error after installing matplotlib from macports

2009-09-15 Thread Jouni K . Seppänen
Damon McDougall damon.mcdoug...@gmail.com writes:

   from matplotlib.figure import Figure
 ValueError: invalid literal for int() with base 10: '836.364'

 I have no clue what is going on. Does anybody have any ideas?

Could you do the following: (if you already exited that Python shell 
and can't reproduce the problem any longer, you can delete your
~/.matplotlib/fontList.cache and try again)

from pdb import pm
pm()

This should get you to a debugger. Then type:

up
p fh
p line
p vals

to get some more information on what is going wrong.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Strange error after installing matplotlib from macports

2009-09-15 Thread Jouni K . Seppänen
Damon McDougall damon.mcdoug...@gmail.com writes:

 (Pdb) p fh
 closed file '/Users/Damon/Library/Fonts/lcmssi8.afm', mode 'r' at  

That's a font that probably came with a TeX distribution and somehow got
installed in your font library.

 (Pdb) p line
 'C 0 ; WX 708.333 ; N Gamma ; B 0 0 836.364 684.027 ;'

Failing on this line is a bug in matplotlib, since the AFM spec says
that bounding-box coordinates are numbers, not integers. Apparently
not many AFM files use that precise bounding boxes, since we haven't run
into this before.

I don't know how the MacPorts packaging system would react to modifying
installed files, but I imagine that applying the attached patch should
fix this.

 Also, after some curiosity, I realised the file ~/.matplotlib/ 
 fontList.cache doesn't exist. In fact, the ~/.matplotlib directory is  
 empty, there aren't even any hidden files. On my other computer,  
 matplotlib works fine and the ~/.matplotlib directory contains three  
 files: fontList.cache, fontManager.cache and tex.cache.

Maybe the files just didn't get written into your directory, since
matplotlib bailed out at the first failure.

Index: lib/matplotlib/afm.py
===
--- lib/matplotlib/afm.py	(revision 7750)
+++ lib/matplotlib/afm.py	(working copy)
@@ -165,7 +165,8 @@
 num = _to_int(vals[0].split()[1])
 wx = _to_float(vals[1].split()[1])
 name = vals[2].split()[1]
-bbox = _to_list_of_ints(vals[3][2:])
+bbox = _to_list_of_floats(vals[3][2:])
+bbox = map(int, bbox)
 # Workaround: If the character name is 'Euro', give it the corresponding
 # character code, according to WinAnsiEncoding (see PDF Reference).
 if name == 'Euro':

-- 
Jouni K. Seppänen
http://www.iki.fi/jks
--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] download

2009-09-09 Thread Jouni K . Seppänen
Michael Droettboom md...@stsci.edu writes:

 This change has gone into effect (for me at least on a Liux box).  Can 
 anyone test Windows and Mac and report back?

Using Firefox 3.5.2 on Mac OS X 10.5, the green download link points to
matplotlib-0.99.0-py2.6-macosx10.5.dmg, and when I change my user agent
header to Internet Explorer, to matplotlib-0.99.0.win32-py2.6.exe.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mpl 0.99 and py2exe

2009-09-09 Thread Jouni K . Seppänen
Werner F. Bruhin werner.bru...@free.fr writes:

 I am getting errors TypeError: unsupported operand type(s) for +=: 
 'NoneType' and 'str' in mlab.pyo after py2exe'd my application.

I think this has been fixed on the trunk for good, by changing all
docstring modifications to use decorators (defined in docstring.py) that
check for nonexistent docstrings. The changes are perhaps too big to
apply on the 0.99 branch.

 I changed it to:
 if psd.__doc__ is not None:
 psd.__doc__ = psd.__doc__ % kwdocd
 else:
 psd.__doc__ = 

 Above is a bit of a hack, if someone can suggest how to correct this in 
 a way which would get accepted as a patch I would search all modules 
 correct them.

I think either this or something like

psd.__doc__ = psd.__doc__ and (psd.__doc__ % kwdocd)

should be acceptable as a bugfix.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] funny bug with greek letters

2009-09-05 Thread Jouni K . Seppänen
Nicolas Chopin nicolas.cho...@bristol.ac.uk writes:

 funny \gamma works, though.

That's because \g has no special meaning, while e.g. \b means backspace:

http://docs.python.org/reference/lexical_analysis.html#string-literals

 On a related note, usetex=True is fancy, but produce much bigger eps
 files for me, so I stick with the standard mathtex rendering.

It is probably best to use the built-in mathtex, unless you have a
specific reason to use TeX.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to do accumulation plots with matplotlib

2009-09-05 Thread Jouni K . Seppänen
nbv4 cp368...@ohiou.edu writes:

 [1,0,0,0,2,3,2,1,0,0,0,2,2,1,3,0,0,3...]

 [...] I want to take this data and display it in a linegraph
 as if it were this data:

 [1,1,1,1,3,5,7,8,8,8,10,12,13,16,16,16,19,...]

You can use numpy.cumsum to transform your data. For example, in ipython
-pylab:

In [4]: x = [1,0,0,0,2,3,2,1,0,0,0,2,2,1,3,0,0,3]

In [5]: cumsum(x)
Out[5]: 
array([ 1,  1,  1,  1,  3,  6,  8,  9,  9,  9,  9, 11, 13, 14, 17, 17, 17,
   20])

In [6]: plot(cumsum(x))
Out[6]: [matplotlib.lines.Line2D object at 0xa945070]

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] preserving transparency in eps

2009-08-31 Thread Jouni K . Seppänen
Chuck Pepe-Ranney cpep...@mines.edu writes:

 The postscript format does not support transparency.  This is not a
 matplotlib limitation but a postscript limitation.  The best solution
 is to save your matplotlib figures as pdf, [...]

 Thanks, I guess my problem is that I am using the latex prosper
 package to make presentation slides but I cannot compile prosper
 documents with pdflatex [...]

You could try creating pdf output from matplotlib and converting it to
ps using ps2ps2, which will flatten the transparent objects into one big
bitmap:

http://ghostscript.com/doc/current/Ps2ps2.htm
http://www.ghostscript.com/pipermail/gs-devel/2009-April/008328.html

You may need to tweak the ps2write parameters, especially the output
resolution, to find the best tradeoff between file size and quality.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] showing current value on boxplot

2009-08-25 Thread Jouni K . Seppänen
Ravi A. ravi.ara...@gmail.com writes:

 I am using boxplot and i wanted to mark current value or any special value
 on the box plot. How do i achieve this? Something like below.

Just plot the special value, with hold=True if you have set the hold
default to false. One small issue is that plot autoscales the view
tightly, which looks bad with the boxes, so you may want to nudge it a
bit:

from pylab import *
boxplot(random((10,10)))
plot(arange(1,11), random(10), 'rx', ms=5, mew=2, hold=True)
a,b = xlim()
xlim(a-.5,b+.5)
show()

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contour lines not hidden by patches

2009-08-25 Thread Jouni K . Seppänen
Auré Gourrier aurelien.gourr...@yahoo.fr writes:

 The patches hide the contourf correctly, as expected, but not the
 contour lines...

Sounds like a zorder problem:

http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html

 Below are the code lines.

Since several details were edited out, the code sample is not runnable,
so I couldn't try it out myself. I think it's probably the zorder,
though.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pareto diagram - align cumulative percentage marker in the middle of the bars

2009-08-25 Thread Jouni K . Seppänen
Werner F. Bruhin werner.bru...@free.fr writes:

 I trying to create a Pareto diagram and would like that the percentage
 marker is center aligned on the bars,

Perhaps the easiest solution is to use bar(...,align='center').

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] per-element marker - possible? how to?

2009-08-22 Thread Jouni K . Seppänen
John Owens john_ow...@yahoo.com writes:

 plot([1,2,3], [1,4,9], markerlist=['A', 'B', 'C'])

 and have it draw the first point with a rendered
 letter 'A', the second with a 'B', and the third with
 a 'C'. 

You could do

text(1,1,'A')
text(2,4,'B')
text(3,9,'C')

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mac os backend not building

2009-08-20 Thread Jouni K . Seppänen
Michiel de Hoon mjldeh...@yahoo.com writes:

 Are you on Mac OS X 10.5 or are you on an earlier version? The error
 message you're seeing indicates that MAC_OS_X_VERSION_10_5 is defined,
 suggesting that you are on Mac OS X 10.5. But then it should be aware
 of CTFontRef ... Did you change anything in your Python setup?

I get the same error on OS X 10.5.8, gcc 4.0.1, Python 2.5.4 downloaded
from python.org. The failing command is:

gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk 
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd 
-fno-common -dynamic -DNDEBUG -g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API 
-I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
 -I/usr/local/include -I/usr/include -I. 
-I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
 -Isrc -Iagg24/include -I. 
-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c 
src/_macosx.m -o build/temp.macosx-10.3-i386-2.5/src/_macosx.o

Note the MacOSX10.4u.sdk in the isysroot and macosx-10.3 in the name of
the build directory. I suspect that this build of Python has been
compiled with some kind of compatibility settings to be usable on
earlier versions of the OS. Simply replacing 10.4 by 10.5 in the
isysroot option causes worse errors:

src/_macosx.m:1:25: error: Cocoa/Cocoa.h: No such file or directory
src/_macosx.m:2:53: error: ApplicationServices/ApplicationServices.h: No such 
file or directory

Can you suggest something further to try?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] bug in imshow for PDF, EPS output

2009-08-20 Thread Jouni K . Seppänen
Michael Fitzgerald astrof...@gmail.com writes:

 Can anyone confirm this bug?  I have added it to the sourceforge
 tracker, ID 2832896.
 https://sourceforge.net/tracker/?func=detailaid=2832896group_id=80706atid=560720

I can see it but haven't been able to make time to investigate yet.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] trouble installing new matplotlib on mac os x

2009-08-14 Thread Jouni K . Seppänen
per freem perfr...@gmail.com writes:

 i am trying to install matplotlib-0.99 on a mac os x machine, with the
 following  python:

 Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
 [GCC 4.0.1 (Apple Inc. build 5465)] on darwin

I think that's the system Python (/usr/bin/python), while the installer
package works with the framework Python (/usr/local/bin/python). See:

http://matplotlib.sourceforge.net/faq/installing_faq.html#os-x-questions
http://www.python.org/download/mac/
http://www.python.org/download/releases/2.5.4/

 i also cannot where the new version was installed. does anyone know
 where the files for the new matplotlib should be? they are not in
 /Library/Frameworks/Python2.5/ it seems.

It should be in

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages

 if i do:

 locate matplotlib | grep 0.99

 nothing comes up. i only see files related to the older matplotlib
 when i do locate matplotlib in the shell.

The locate database is only updated weekly (and that's assuming that you
keep your Mac running in the early hours in which the update is run by
default). Try

sudo periodic weekly

to update the database if you want locate to find recently created
files. The update can take quite some time.

 any ideas how i can install this?  i wanted to try the .egg
 installation with easy_install but when i do:

 easy_install matplotlib

 it matches to a 0.98 version of matplotlib, not 0.99.

easy_install can be really bothersome. If you have an easy-install.pth
file in your site-packages directory, edit it and remove references to
the old version of matplotlib.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting lines in the background of other lines

2009-07-17 Thread Jouni K . Seppänen
per freem perfr...@gmail.com writes:

 then the horizontal line appears ON TOP of the other two lines -- i want it
 to be the opposite, i want the horizontal line to be in the background. how
 can i do this?

Use the zorder keyword.

http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting problems in qt4agg backend on Mac OS X

2009-07-17 Thread Jouni K . Seppänen
Jan Strube curious...@gmail.com writes:

 The png roughly looks like I would expect (although I can't figure out
 how to plot a straight black horizontal line at y=0. pylab.plot
 doesn't seem to do what I want)

How about axhline?

 The eps doesn't get filled with the correct colors, and the pdf and
 the svg don't work at all.

But there is a pdf file at

https://jstrube.web.cern.ch/jstrube/matplotlib_testcase/lambdaPbarGamma_all.pdf

When you say that pdf doesn't work at all, do you mean that the hatch
patterns are missing?

I just tried examples/pylab_examples/hatch_demo.py, and both the pdf and
svg backends produced correct-looking output. Does hatch_demo.py work
correctly in your environment?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting figure font to helvetica

2009-06-29 Thread Jouni K . Seppänen
per freem perfr...@gmail.com writes:

 i am trying to use the Helvetica font on matplotlib. i am using mac os x (so
 i definitely have helvetica installed) 

It might be in a format that matplotlib doesn't really handle. However,
Helvetica is one of the core fonts in PDF so if you set
pdf.use14corefonts to True, you should be able to use Helvetica, and the
reader application will supply the font (or approximate it with
something else). This is deprecated in the latest version of the spec,
but it should work just fine.

 i verified that plt.rcParams gets modified to use 'Helvetica' as the value
 for font.family, etc. but i still get the default font used in all of these
 figures. 

 I just wanted to add: if i simply set the font to Arial, using
 
 rc('font',**{'family':'sans-serif','sans-serif':['Arial']})
 
 then it works. But the same call with Helvetica still defaults to that
 Bitstream/default font of matplotlib. any idea why this might be? could
 matplotlib be confusing helvetica with bitstream?

The font-selection system is somewhat complicated. I suggest running
your script with --verbose-debug with both Arial and Helvetica as the
value of font.sans-serif, and diffing the outputs to see what is going
on. I suspect that Arial is a TTF file while Helvetica is in some
Mac-specific format. The best solution would be to make matplotlib
handle those formats, but probably the most practical solution is to
use something like fondu to convert the font into TTF:
http://fondu.sourceforge.net/

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


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


Re: [Matplotlib-users] savefig as pdf not generating vector graphics?

2009-06-28 Thread Jouni K . Seppänen
per freem perfr...@gmail.com writes:

 i am using matplotlib 0.98.5.2 on Mac OS X. i am plotting a histogram
 and then saving it as .pdf. The x and y labels use some symbols from
 latex, and i have useTex set to true in my rcParams.

Do you really need usetex? Matplotlib's usual mathtext engine is pretty
good and doesn't require any external programs.

 The problem is that myfig.pdf for some reason renders the figure's x
 and y labels as *images* rather than vector graphics.

Could you send the resulting pdf file to me off-list?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


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


Re: [Matplotlib-users] savefig as pdf not generating vector graphics?

2009-06-28 Thread Jouni K . Seppänen
per freem perfr...@gmail.com writes:

 you're right, i don't need to use usetex -- i removed it, but the problem
 still persists. here is the pdf that it generates (code below). any idea
 what is happening here? thanks very much for your help.

The file you sent was not generated by the pdf backend but by Mac OS X
10.5.6 Quartz PDFContext, which probably means that the OS X backend
saves pdf files using the OS X machinery and not the pdf backend. Indeed
the formulas look like bitmaps.

 from scipy import *
 import matplotlib.pyplot as plt
 from matplotlib import rc
 rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
 import matplotlib
 matplotlib.use('PDF')

You are trying to use the pdf backend, but the last line quoted above
has no effect because you have already imported pyplot, which causes the
backend to be set as directed by your matplotlibrc file. Any call to
matplotlib.use needs to be done before you import pyplot.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks

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


Re: [Matplotlib-users] exporting PYTHONPATH causes matplotlib not to load

2009-06-09 Thread Jouni K . Seppänen
John Hunter jdh2...@gmail.com writes:

 es, this is your problem.  You have the matplotlib source directory in
 your HOME directory and when you run from your home directory, it is
 being picked up instead of the installation directory.  I usually name
 my src tree mpl to avoid this problem

I don't know why there is an empty __init__.py in the source directory,
but would something break if the file printed out a warning, like

print '''
  Warning: your import %s is picking up the matplotlib source
  directory, which is not usable as a Python module. To avoid this
  problem, either rename the directory to e.g. mpl or move it to
  some directory that is not on your Python path.
''' % __name__

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Failure to build due to missing X?

2009-05-24 Thread Jouni K . Seppänen
John R. Cary c...@txcorp.com writes:

 $ python setup.py install --prefix=/d/facets/contrib
 connect 173.8.244.121 port 6000: Connection timed out
 X connection to foo.bar.com:12.0 broken (explicit kill or server shutdown).

Try unsetting your DISPLAY environment variable, e.g.

env DISPLAY= python setup.py install --prefix=/d/facets/contrib

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Reducing png file size

2009-05-18 Thread Jouni K . Seppänen
Jesper Larsen jesper.webm...@gmail.com writes:

 Unfortunately the files are quite big (up to ~300 kb). I have however
 tried using the Linux tool pngnq to reduce the file size with a factor
 ~3-4 with almost no degradation of the result.

   Pixel depth (Pixel Depth): 32
   Colour Type (Photometric Interpretation): RGB with alpha channel

   Pixel depth (Pixel Depth): 8
   Colour Type (Photometric Interpretation): PALETTED COLOUR (256
 colours, 0 transparent)

This means pngnq has quantized the original RGBA image with 8 bits per
channel to an image with a 256-color palette. I don't think Agg has any
support for rendering directly to a paletted image, so to achieve
similar results, you would have to do the quantization in a separate
pass anyway.

 I am not using transparency for anything. For a web application a
 reduction from 300 kb to 90 kb is really important so I hope you have
 some good ideas.

A web application needs to be fast, right? According to its home page,
pngnq is limited mostly to off-line uses rather than real time image
delivery. You could take a look at PIL to see if it has any fast
quantization algorithms, and pass your result to it as in the
to_numeric.py example (see also webapp_demo.py for how to avoid using
the pylab machinery for figure management). If not, you could always
implement some fast quantization algorithm in numpy:

http://en.wikipedia.org/wiki/Color_quantization

My guess is that if you always produce similar-looking images, you could
fix the palette off-line using whatever fancy algorithm you like, and
then the actual conversion could be done pretty fast, especially if you
can forgo dithering - perhaps for many types of charts it is not
necessary.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] One more question regarding to boxplotting

2009-05-14 Thread Jouni K . Seppänen
Gökhan SEVER gokhanse...@gmail.com writes:

 Still a question stays in my mind: How do you decribe box-whisker plots in
 your writing while using matplotlib's boxplot command? It uses 25, 50, 75th
 percentiles of the data for sure, but apart from what I expected whiskers
 are not at 5th, and 95th percentiles of the data respectively.

I'm too overwhelmed by other stuff to comment at length, but I don't
think the whiskers are usually expected to be at the 5th and 95th
percentiles:

http://en.wikipedia.org/wiki/Box_plot

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with usetex \color

2009-05-12 Thread Jouni K . Seppänen
Sebastian Busch webmas...@thamnos.de writes:

 I would have liked to get an aligned legend, like

 d =  9m
 d = 10m

 In order to achieve that, i was trying to print a white (=invisible) 1
 whenever the number was smaller than 10 as spaceholder (I do not want to
 use a monospaced font). 

Does the \phantom trick work? I.e., r'd = \phantom{1}9m' or something
like that?

 Obviously, this doesn't work any more as soon as you reach 20...

Even if your font is not monospaced, it might have tabular figures:

http://www.fonts.com/aboutfonts/articles/fyti/propvstabfigures.htm

I think at least Computer Modern Roman (the default font in TeX) does
have tabular figures.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] figuresize and dpi

2009-05-12 Thread Jouni K . Seppänen
Chaitanya Krishna icym...@gmail.com writes:

 I define the figure size as fig = plt.figure(figsize=(7,0.75*7)), then
 plot the figure and save it as both a png and an eps.

When you save as png, you can set the dpi, and if you use e.g. 100, the
figure will be 700 pixels wide; if you use 75, it will be 525 pixels
wide. The dpi is saved in the png file, so the viewer application can in
principle know how to rescale it.

When you save as eps, which is a vector graphics format, the dpi
argument will not have much effect (with the exception of resampled
images). It is up to the viewer application to show it at the correct
size. When you print the file, it should appear at the right size,
although it is not impossible for there to be some measurable error.
Presumably a professional publisher will make sure that their printing
equipment comes as close as possible to the intended size.

 If I then measure the size of the figure as displayed (displayed with
 0 zoom) on the computer screen with a ruler, it does not measure 7 in.
 Why is it so? Am I doing something wrong.

Often, the viewer application does not know what the dpi value of the
screen is - popular guesses are 75 and 100, but this naturally depends
on the physical size of the screen. For example, a resolution of 1280 x
1024 at 15 inches or 17 inches will have a different dpi, and if the
viewer application (or the operating system, or the windowing system)
just has some default guess, you will not see the correct size on the
screen.

I think The GIMP has a dpi calibration dialog where it shows rulers and
asks you to measure them with a physical ruler. You might want to
install The GIMP, set up the dpi and use it to view your png files.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] svn revision number

2009-05-08 Thread Jouni K . Seppänen
Thomas Robitaille thomas.robitai...@gmail.com writes:

 In [2]: matplotlib.__revision__
 Out[2]: '$Revision: 6887 $'

 but this isn't actually the current revision number, I have upgraded  
 to 7096 (I'm suspecting that 6887 is the revision number for 0.98.5.2)

The way Subversion works, 6887 is simply the latest revision in which
matplotlib/__init__.py was changed. If you have a Subversion checkout,
you can use the svnversion command to find out the revision of the
checkout. This could in principle be incorporated into the release
process to embed the latest revision somewhere in the source code.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] OS X binary installer broken on 10.4? (was: O pylab why do you refuse to import?)

2009-05-07 Thread Jouni K . Seppänen
John Seales praxbaf...@hotmail.com writes:

  I'm using python 2.5.2 on a macbook, intel microprocessor, mac os 10.4.11

 I installed matplotlib from the dmg file. I clicked on the icon to install it.

I assume you mean the mpkg file - I don't see any dmg file on the
download page. It seems to me that something is wrong with that file,
since release/osx/Makefile compiles its own Freetype and attempts to
link to it statically, but the file ft2font.so distributed within the
mpkg installer links dynamically to /usr/X11R6/lib/libfreetype.6.dylib.

AFAIK, the static linking is done precisely to avoid version mismatches
between different versions of freetype, zlib, and png on various
versions of OS X. Several *.so files within the mpkg link to
/usr/X11R6/lib/libfreetype.6.dylib and /usr/lib/libz.1.dylib (though,
curiously, none link to the system libpng).

I suppose this is exactly the kind of problem that results from dynamic
linking to a wrong version of freetype:

  ImportError: 
  dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/ft2font.so,
   2): Library not loaded: /usr/X11R6/lib/libfreetype.6.dylib
Referenced from: 
  /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/ft2font.so
Reason: image not found


-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installation issue

2009-04-28 Thread Jouni K . Seppänen
Bala subramanian bala.biophys...@gmail.com writes:

 I think freetype is already installed in Fedora10. When i search yum as
 follows, yum says freetype is installed already.

You probably need to install a package named freetype-devel (or
something like that) to get the freetype headers you need for compiling
matplotlib.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Register Now  Save for Velocity, the Web Performance  Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance  Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installation issue

2009-04-28 Thread Jouni K . Seppänen
Bala subramanian bala.biophys...@gmail.com writes:

 Meanwhile i would like to know. Suppose if i install the latest mpl that i
 just downloaded, will it overwrite the mpl version 0.98.1 previously
 installed with yum ? If not, when i give ipython -pylab, which version will
 be loaded, I mean which version would be my default.

That will depend on how Python is configured in Fedora (I have no idea)
and what command-line options you use when you install matplotlib. See

http://docs.python.org/install/

for the details.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Register Now  Save for Velocity, the Web Performance  Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance  Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] line properties

2009-04-27 Thread Jouni K . Seppänen
Sandro Tosi mo...@debian.org writes:

 I think there's some sort of typo there, since it's setp

Yes, it used to be set but then Python added the set data type with the
same name, so references to the old name could remain in some
documentation. This seems to be fixed in the current version of the
tutorial, though:

http://matplotlib.sourceforge.net/users/pyplot_tutorial.html#id2

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Crystal Reports #45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  1   2   3   >