From 3a851f26b461b02cc9d9f2fdaf5587183dae1a07 Mon Sep 17 00:00:00 2001 From: "SANDIA\\jaraco" Date: Fri, 6 Jan 2006 20:59:26 +0000 Subject: [PATCH] Now import the modules into the SVG namespace. Began adding support to Plot to support maximum x & y values, but this currently doesn't work as the axis labels don't get generated correctly with this method. --- Plot.py | 8 ++++++++ __init__.py | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Plot.py b/Plot.py index 7d21624..3d704f3 100644 --- a/Plot.py +++ b/Plot.py @@ -119,6 +119,11 @@ class Plot( SVG.Graph ): min_x_value = None "Set the minimum value of the Y axis" min_y_value = None + "Set the maximum value of the X axis" + max_x_value = None + "Set the maximum value of the Y axis" + max_y_value = None + stacked = False @apply @@ -160,6 +165,9 @@ class Plot( SVG.Graph ): side = { 'x': 'right', 'y': 'top' }[axis] data_index = getattr( self, '%s_data_index' % axis ) max_value = max( map( lambda set: max( set['data'][data_index] ), self.data ) ) + spec_max = getattr( self, 'max_%s_value' % axis ) + if spec_max is not None: + max_value = max( max_value, spec_max ) min_value = min( map( lambda set: min( set['data'][data_index] ), self.data ) ) spec_min = getattr( self, 'min_%s_value' % axis ) if spec_min is not None: diff --git a/__init__.py b/__init__.py index b3cc1d2..823ce03 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,7 @@ #!/usr/bin/env python __all__ = ( 'Plot', 'TimeSeries' ) + from xml.dom import minidom as dom from operator import itemgetter from itertools import islice @@ -702,4 +703,6 @@ class class_dict( object ): def keys( self ): # dir returns a good guess of what attributes might be available - return dir( self.__obj__ ) \ No newline at end of file + return dir( self.__obj__ ) + +import Plot, TimeSeries \ No newline at end of file