[Matplotlib-users] Missing files on the web documentation

2009-06-27 Thread LB
Hi,

The documentation presented on http://matplotlib.sourceforge.net/examples is
a very good source of information but on some pages it doesn't give all the
data needed to have the example running.

Indeed, some example needs external files and they are not given in the web
documentation, for example :

http://matplotlib.sourceforge.net/examples/user_interfaces/mpl_with_glade.html
needs   mpl_with_glade.glade
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_wx3.html
needs   ../data/embedding_in_wx3.xrc

I thing there should be some links on the web pages to download theses
files.
At least, it should be said in the docstring where to find them, don't you
think ?

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


[Matplotlib-users] ImportError when import pylab

2009-06-27 Thread Daniel
hi list,

I'm new to matplotlib. My environment is WinXP, PythonWin 2.6.2, NumPy
1.3.0, matplotlib 0.98.5.3.

 import matplotlib.pylab as pylab
Traceback (most recent call last):
  File interactive input, line 1, in module
  File D:\Python26\lib\site-packages\matplotlib\pylab.py, line 253, in
module
from matplotlib.pyplot import *
  File D:\Python26\lib\site-packages\matplotlib\pyplot.py, line 75, in
module
new_figure_manager, draw_if_interactive, show = pylab_setup()
  File D:\Python26\lib\site-packages\matplotlib\backends\__init__.py, line
25, in pylab_setup
globals(),locals(),[backend_name])
  File D:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py,
line 8, in module
import tkagg # Paint image to Tk photo blitter extension
  File D:\Python26\lib\site-packages\matplotlib\backends\tkagg.py, line 1,
in module
import _tkagg
ImportError: DLL load failed: cannot find the module

I searched the web and it's said because of lack of msvcp71.dll, but there
is already on in my C:\windows\system32\

anyone can help?
Thanks.
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Missing files on the web documentation

2009-06-27 Thread John Hunter
On Sat, Jun 27, 2009 at 1:44 AM, LBbravo.l...@gmail.com wrote:

 I thing there should be some links on the web pages to download theses
 files.
 At least, it should be said in the docstring where to find them, don't you
 think ?

It would be a good idea -- but for now you can grab the source
distribution *.tar.gz from the download page and look in the
examples subdirectory.  All the code, data and support files are
there (the web examples are automatically built from this directory).
If you are on a linux/unix box or any box that has an svn client, the
easiest way is to just check out::

  svn co 
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib
matplotlib
  cd mpl/examples

or if you just want the examples rather than the whole source tree::

   svn co 
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib/examples
mpl_examples

but I suggest getting the source because some of the examples only run
on svn and you may want to install from svn to use them

  http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn


JDH

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


Re: [Matplotlib-users] Stopping Legend From Overlapping the Graph

2009-06-27 Thread Chris Spencer
Thanks. Is that some sort of blending edge feature? I just installed
0.98.5.3, but the sample code gives me the error:

TypeError: __init__() got an unexpected keyword argument 'bbox_to_anchor'

On Thu, Jun 25, 2009 at 10:20 PM, Jae-Joon Leelee.j.j...@gmail.com wrote:
 The linked page below shows how you put the legend above the graph.

 http://matplotlib.sourceforge.net/users/plotting/legend.html#legend-location

 You can put it below the axes by adjusting the bbox_to_anchor parameter.
 Try something like
  bbox_to_anchor=(0., -0.1, 1., -0.1), loc=1

 Make sure to adjust the suplot parameter (or axes location) to make
 enough room for the legend.

 -JJ



 On Thu, Jun 25, 2009 at 9:22 PM, Chris Spencerchriss...@gmail.com wrote:
 How do you show the legend below the graph, so it doesn't overlap at
 all with the graph? The docs for the legend() loc parameter only
 seem to specify where *on* the graph you want it to show, which is
 driving me nuts because even using best, it usually hides some of my
 data.

 I want to see *all* of my graph, as well as the legend. Is there any
 way to do this with pylab?

 Any help is appreciated.

 Chris

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



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


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

2009-06-27 Thread per freem
hi all,

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. The code is:

import matplotlib.pyplot as plt
my_fig = plt.figure(figsize=(5,5)), dpi=100)
plt.hist(rand(100), 10)
plt.xlabel(r\alpha)
plt.ylabel(r\beta\kappa)
plt.savefig('myfig.pdf')

The problem is that myfig.pdf for some reason renders the figure's x and y
labels as *images* rather than vector graphics. Strangely, the labels of the
units on the x and y axes are rendered as vector fonts correctly as they
should -- it is only the x and y labels that somehow are wrongly generated
as images.

how can i make it so everything is generated as a vector graphic in this
pdf?

thanks very much.

i am attaching my rcParams settings below in case it helps:

{'agg.path.chunksize': 0,
 'axes.axisbelow': False,
 'axes.edgecolor': 'k',
 'axes.facecolor': 'w',
 'axes.formatter.limits': [-7, 7],
 'axes.grid': False,
 'axes.hold': True,
 'axes.labelcolor': 'k',
 'axes.labelsize': 'medium',
 'axes.linewidth': 1.0,
 'axes.titlesize': 'large',
 'axes.unicode_minus': True,
 'backend': 'MacOSX',
 'backend_fallback': True,
 'cairo.format': 'png',
 'contour.negative_linestyle': 'dashed',
 'datapath': '/Library/Python/2.5/site-packages/matplotlib/mpl-data',
 'docstring.hardcopy': False,
 'figure.autolayout': False,
 'figure.dpi': 80,
 'figure.edgecolor': 'w',
 'figure.facecolor': '0.75',
 'figure.figsize': [8.0, 6.0],
 'figure.subplot.bottom': 0.10001,
 'figure.subplot.hspace': 0.20001,
 'figure.subplot.left': 0.125,
 'figure.subplot.right': 0.90002,
 'figure.subplot.top': 0.90002,
 'figure.subplot.wspace': 0.20001,
 'font.cursive': ['Apple Chancery',
  'Textile',
  'Zapf Chancery',
  'Sand',
  'cursive'],
 'font.family': 'sans-serif',
 'font.fantasy': ['Comic Sans MS',
  'Chicago',
  'Charcoal',
  'ImpactWestern',
  'fantasy'],
 'font.monospace': ['Bitstream Vera Sans Mono',
'DejaVu Sans Mono',
'Andale Mono',
'Nimbus Mono L',
'Courier New',
'Courier',
'Fixed',
'Terminal',
'monospace'],
 'font.sans-serif': ['Helvetica'],
 'font.serif': ['Bitstream Vera Serif',
'DejaVu Serif',
'New Century Schoolbook',
'Century Schoolbook L',
'Utopia',
'ITC Bookman',
'Bookman',
'Nimbus Roman No9 L',
'Times New Roman',
'Times',
'Palatino',
'Charter',
'serif'],
 'font.size': 12.0,
 'font.stretch': 'normal',
 'font.style': 'normal',
 'font.variant': 'normal',
 'font.weight': 'normal',
 'grid.color': 'k',
 'grid.linestyle': ':',
 'grid.linewidth': 0.5,
 'image.aspect': 'equal',
 'image.cmap': 'jet',
 'image.interpolation': 'bilinear',
 'image.lut': 256,
 'image.origin': 'upper',
 'image.resample': False,
 'interactive': False,
 'legend.axespad': 0.5,
 'legend.borderaxespad': 0.5,
 'legend.borderpad': 0.40002,
 'legend.columnspacing': 2.0,
 'legend.fancybox': False,
 'legend.fontsize': 'large',
 'legend.handlelen': 0.050003,
 'legend.handlelength': 2.0,
 'legend.handletextpad': 0.80004,
 'legend.handletextsep': 0.02,
 'legend.isaxes': True,
 'legend.labelsep': 0.01,
 'legend.labelspacing': 0.5,
 'legend.loc': 'upper right',
 'legend.markerscale': 1.0,
 'legend.numpoints': 2,
 'legend.pad': 0,
 'legend.shadow': False,
 'lines.antialiased': True,
 'lines.color': 'b',
 'lines.dash_capstyle': 'butt',
 'lines.dash_joinstyle': 'miter',
 'lines.linestyle': '-',
 'lines.linewidth': 1.0,
 'lines.marker': 'None',
 'lines.markeredgewidth': 0.5,
 'lines.markersize': 6,
 'lines.solid_capstyle': 'projecting',
 'lines.solid_joinstyle': 'miter',
 'maskedarray': False,
 'mathtext.bf': 'serif:bold',
 'mathtext.cal': 'cursive',
 'mathtext.fallback_to_cm': True,
 'mathtext.fontset': 'cm',
 'mathtext.it': 'serif:italic',
 'mathtext.rm': 'serif',
 'mathtext.sf': 'sans\\-serif',
 'mathtext.tt': 'monospace',
 'numerix': 'numpy',
 'patch.antialiased': True,
 'patch.edgecolor': 'k',
 'patch.facecolor': 'b',
 'patch.linewidth': 1.0,
 'path.simplify': False,
 'pdf.compression': 6,
 'pdf.fonttype': 3,
 'pdf.inheritcolor': False,
 'pdf.use14corefonts': False,
 'plugins.directory': '.matplotlib_plugins',
 'polaraxes.grid': True,
 'ps.distiller.res': 6000,
 'ps.fonttype': 3,
 'ps.papersize': 'letter',
 'ps.useafm': False,
 'ps.usedistiller': False,
 'savefig.dpi': 100,
 'savefig.edgecolor': 'w',
 'savefig.facecolor': 'w',
 'savefig.orientation': 'portrait',
 'svg.embed_char_paths': True,
 'svg.image_inline': True,
 

Re: [Matplotlib-users] Stopping Legend From Overlapping the Graph

2009-06-27 Thread Jae-Joon Lee
sorry.
As guillaume has mentioned, you need to install mpl from svn.

Here is some workaround you can try. I guess it would work with 0.98.5.3.
Basically, you create a separate axes for a legend.

ax1 = axes([0.1, 0.2,0.8, 0.7])
p1, = ax1.plot([1,2,3])
p2, = ax1.plot([3,2,1])

ax2 = axes([0.1, 0.1, 0.8, 0.01], frameon=False)
ax2.xaxis.set_visible(False)
ax2.yaxis.set_visible(False)
l = ax2.legend([p1, p2], [Legend1, Legend2], mode=expand, ncol=2,
   borderaxespad=0.)


-JJ



On Sat, Jun 27, 2009 at 6:00 PM, Chris Spencerchriss...@gmail.com wrote:
 Thanks. Is that some sort of blending edge feature? I just installed
 0.98.5.3, but the sample code gives me the error:

 TypeError: __init__() got an unexpected keyword argument 'bbox_to_anchor'

 On Thu, Jun 25, 2009 at 10:20 PM, Jae-Joon Leelee.j.j...@gmail.com wrote:
 The linked page below shows how you put the legend above the graph.

 http://matplotlib.sourceforge.net/users/plotting/legend.html#legend-location

 You can put it below the axes by adjusting the bbox_to_anchor parameter.
 Try something like
  bbox_to_anchor=(0., -0.1, 1., -0.1), loc=1

 Make sure to adjust the suplot parameter (or axes location) to make
 enough room for the legend.

 -JJ



 On Thu, Jun 25, 2009 at 9:22 PM, Chris Spencerchriss...@gmail.com wrote:
 How do you show the legend below the graph, so it doesn't overlap at
 all with the graph? The docs for the legend() loc parameter only
 seem to specify where *on* the graph you want it to show, which is
 driving me nuts because even using best, it usually hides some of my
 data.

 I want to see *all* of my graph, as well as the legend. Is there any
 way to do this with pylab?

 Any help is appreciated.

 Chris

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




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