invisilbe line

lh=len(h.haplist)
  Xrange=[map[m] for m in [y for x,y in h.haplist]]
  Yrange=[-math.log10(h.pval) for i in range(lh)]
  line=canvas.figure.axes[0].plot(Xrange, Yrange, symbol)
  line.set_visible(Plot.False)

    Jean-Baptiste> Any idea ?

plot always return *a list* of lines. So you need to do

  lines = canvas.figure.axes[0].plot(Xrange, Yrange, symbol)
  lines[0].set_visible(Plot.False) # get the first element of the list

JDH

It workls great now !

Thanks

Jean-Baptiste

···

On Sun, 14 Mar 2004 13:26:20 -0600 John Hunter <jdhunter@...8...> wrote:

  lh=len(h.haplist)
  Xrange=[map[m] for m in [y for x,y in h.haplist]]
  Yrange=[-math.log10(h.pval) for i in range(lh)]
  line=canvas.figure.axes[0].plot(Xrange, Yrange, symbol)
  line.set_visible(Plot.False)

    Jean-Baptiste> Any idea ?

plot always return *a list* of lines. So you need to do

  lines = canvas.figure.axes[0].plot(Xrange, Yrange, symbol)
  lines[0].set_visible(Plot.False) # get the first element of the list

JDH

--
-----------------------------
Jean-Baptiste.Cazier@...15...

Department of Statistics
deCODE genetics Sturlugata,8
570 2993 101 Reykjavík

I can't seem to get multiple plots to draw on the same figure under TkAgg.
In the below example, the cos() doesn't show up, and the tan produces an
error. This seems to be repeatable for arbitrary cases of trying to plot
2 or 3 lines together on the one plot.

Cheers and thanks for matplotlib,
Matthew.

$ python
Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from matplotlib.matlab import *
xx = arange(0, 3, 0.1)
plot(sin(xx))

[<matplotlib.lines.Line2D instance at 0x819613c>]

plot(cos(xx))

[<matplotlib.lines.Line2D instance at 0x8636444>]

plot(tan(xx))

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/site-packages/matplotlib/matlab.py", line 788,
in plot
    draw_if_interactive()
  File
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_tkagg.py",
line 46, in draw_if_interactive
    figManager.show()
  File
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_tkagg.py",
line 127, in show
    self.canvas.draw()
  File
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_agg.py",
line 334, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.2/site-packages/matplotlib/artist.py", line 79,
in draw self._draw(renderer, *args, **kwargs)
  File "/usr/lib/python2.2/site-packages/matplotlib/figure.py", line 81,
in _draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.2/site-packages/matplotlib/artist.py", line 79,
in draw self._draw(renderer, *args, **kwargs)
  File "/usr/lib/python2.2/site-packages/matplotlib/axes.py", line 493, in
_draw line.draw(renderer)
  File "/usr/lib/python2.2/site-packages/matplotlib/artist.py", line 79,
in draw self._draw(renderer, *args, **kwargs)
  File "/usr/lib/python2.2/site-packages/matplotlib/lines.py", line 177,
in _draw
    gc.set_foreground(self._color)
  File "/usr/lib/python2.2/site-packages/matplotlib/backend_bases.py",
line 230, in set_foreground
    self._rgb = colorConverter.to_rgb(fg)
  File "/usr/lib/python2.2/site-packages/matplotlib/colors.py", line 82,
in to_rgb
    error_msg(msg)
NameError: global name 'error_msg' is not defined

···

Hi

Just a quick note that the EPS bounding box still seems to be buggy in
matplotlib 0.52.

If I save an EPS using the save button on a GTK figure window, the right
hand side gets slightly clipped when printed.

If I do the same from a TkAgg window, most of the plot gets clipped.

Cheers,
Matthew.