Changeset 2
- Timestamp:
- 12/22/05 12:42:44 (5 years ago)
- Files:
-
- LICENSE (added)
- sparkplot.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sparkplot.py
r1 r2 27 27 draw_hspan=False, hspan_min=-1, hspan_max=0, 28 28 label_format="", currency='$', transparency=False, verbose=0): 29 29 30 self.type = type 30 31 self.data = data … … 127 128 Plot sparkline graphic by using various matplotlib functions. 128 129 """ 130 129 131 if len(self.data) == 0: 130 132 self.data = self.get_input_data() … … 179 181 180 182 # Create a figure with the given width, height and dpi 181 fig = figure( 1,figsize=(fig_width, fig_height), dpi=150)183 fig = figure(figsize=(fig_width, fig_height), dpi=150) 182 184 183 185 if self.type.startswith('line'): … … 222 224 # We leave some space around the data points so that the plot points for 223 225 # the first/last/min/max points are displayed 224 axis([-1, num_points, 0.9*min_data, 1.1*max_data])226 axis([-1, num_points, min_data - (abs(min_data)*0.1), max_data + (abs(max_data)*0.1) ]) 225 227 226 228 # Turn off all axis display elements (frame, ticks, tick labels) … … 286 288 sparkplot.process_args() 287 289 sparkplot.plot_sparkline() 290
