plotting two lists

ok, so i've done plotting two list on boa/wxpython now, i

    > want to add labels and everything else to my graph... adding
    > labels i've done this:

Glad to see you are getting this working...

    self.figure = Figure()
    self.axes = self.figure.add_subplot(111)
    self.axes.plot(parent.listX,parent.listY, 'bo')
    self.axes.xlabel(parent.Xaxis.GetStringSelection())

    > AttributeError: Subplot instance has no attribute 'xlabel'

Rather than giving you the answer, I'll show you how to find it....

You can use python's introspection capability (help, dir, type) to ask
an object about itself. You can insert print statements directly into
your code

  print dir(self.axes) # see below the results of dir(self.axes)

and look for methods that have the right names. Or you can keep a
python shell open and use the python help system. If for example, at
the shell you do help(self.axes), you'll find

  Help on instance of Subplot:
  <matplotlib.axes.Subplot instance>

So self.axes is a Subplot instance. You can then import the Subplot
class and get much richer help by doing

  >>> from matplotlib.axes import Subplot
  >>> help(Subplot)

If you don't like working from the shell, head on over to the class
docs at http://matplotlib.sourceforge.net/classdocs.html and click on
the "axes" link and near the top of your screen you'll seen a link
that reads

  Subplot(SubplotBase, Axes)

That means the subplot class is derived from SubplotBase and Axes.
Click on Subplot, and read through the available methods. If you get
impatient, search the web page for "xlabel"

Good luck!
JDH

Python 2.3.3 (#2, Apr 13 2004, 17:41:29)
[GCC 3.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from matplotlib.figure import Figure
fig = Figure()
ax = fig.add_subplot(111)
help(ax)

dir(ax)

['__doc__', '__init__', '__module__', '_alpha', '_axisbg', '_cid', '_clipon', '_connected', '_contourHelper', '_contourLabeler', '_cursorProps', '_events', '_frameon', '_get_lines', '_get_patches_for_fill', '_get_verts_in_data_coords', '_gridOn', '_hold', '_init_axis', '_label', '_lod', '_position', '_send_xlim_event', '_send_ylim_event', '_set_artist_props', '_set_lim_and_transforms', '_sharex', '_sharey', '_transform', '_transformSet', '_visible', 'add_artist', 'add_collection', 'add_line', 'add_patch', 'add_table', 'aname', 'artists', 'autoscale_view', 'axesPatch', 'axhline', 'axhspan', 'axison', 'axvline', 'axvspan', 'bar', 'barh', 'bbox', 'bottom', 'boxplot', 'cla', 'clabel', 'clear', 'clipbox', 'cohere', 'colNum', 'collections', 'connect', 'contour', 'contourf', 'csd', 'dataLim', 'disconnect', 'draw', 'errorbar', 'figBottom', 'figH', 'figLeft', 'figW', 'figure', 'fill', 'fmt_xdata', 'fmt_ydata', 'format_coord', 'format_xdata', 'format_ydata', 'get_alpha', 'get_axis_bgcolor', 'get_child_artists', 'get_clip_on', 'get_cursor_props', 'get_figure', 'get_frame', 'get_images', 'get_label', 'get_legend', 'get_lines', 'get_position', 'get_transform', 'get_visible', 'get_xaxis', 'get_xgridlines', 'get_xlim', 'get_xscale', 'get_xticklabels', 'get_xticklines', 'get_xticks', 'get_yaxis', 'get_ygridlines', 'get_ylim', 'get_yscale', 'get_yticklabels', 'get_yticklines', 'get_yticks', 'get_zorder', 'grid', 'has_data', 'hist', 'hlines', 'hold', 'images', 'imshow', 'in_axes', 'is_figure_set', 'is_first_col', 'is_first_row', 'is_last_col', 'is_last_row', 'is_transform_set', 'ishold', 'left', 'legend', 'legend_', 'lines', 'loglog', 'numCols', 'numRows', 'panx', 'pany', 'patches', 'pcolor', 'pcolor_classic', 'pick', 'pie', 'plot', 'plot_date', 'psd', 'quiver', 'right', 'rowNum', 'scaled', 'scatter', 'scatter_classic', 'semilogx', 'semilogy', 'set_alpha', 'set_axis_bgcolor', 'set_axis_off', 'set_axis_on', 'set_clip_box', 'set_clip_on', 'set_cursor_props', 'set_figure', 'set_frame_on', 'set_label', 'set_lod', 'set_position', 'set_title', 'set_transform', 'set_visible', 'set_xlabel', 'set_xlim', 'set_xscale', 'set_xticklabels', 'set_xticks', 'set_ylabel', 'set_ylim', 'set_yscale', 'set_yticklabels', 'set_yticks', 'set_zorder', 'specgram', 'spy', 'spy2', 'stem', 'table', 'tables', 'text', 'texts', 'title', 'toggle_log_lineary', 'top', 'transAxes', 'transData', 'update', 'update_datalim', 'update_datalim_numerix', 'update_from', 'viewLim', 'vlines', 'xaxis', 'yaxis', 'zoomx', 'zoomy', 'zorder']

···

Hi,

I am trying to construct coloured contour maps, but when I do:

from pylab import *

clabel is not there. Was this removed? The docs suggest that clabel is part of the pylab module.

thanks,
Mark

Sorry - problem solved. I was 0.01 versions behind on the computer I was using. Thanks for adding such a great feature!
- Mark

Hi,

I am trying to construct coloured contour maps, but when I do:

from pylab import *

clabel is not there. Was this removed? The docs suggest that clabel is part of the pylab module.

thanks,
Mark

-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

.............................................................................
Mark Engelhardt
Pande and Herschlag groups
S257 Clarke Center, 318 Campus Drive
Stanford University, Stanford, CA 94305
marke@...200...
http://www.stanford.edu/~marke/

···

On Apr 28, 2005, at 1:43 AM, Mark Engelhardt wrote: