Issue 34 in scitools: scitools.aplotter.plot() crashes and burns on valid input

1 view
Skip to first unread message

scit...@googlecode.com

unread,
Feb 12, 2015, 4:09:21 PM2/12/15
to scitoo...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 34 by zli...@ns.sympatico.ca: scitools.aplotter.plot() crashes
and burns on valid input
https://code.google.com/p/scitools/issues/detail?id=34

What steps will reproduce the problem?
1. from scitools.aplotter import plot
2. l1 = [16, 33, 50] ; l2 = [36.94805848, 59.48372445, 63.57076211]
3. aplotter.plot(l1, l2)

What is the expected output? What do you see instead?
I expect an ASCII plot.
Instead, I get
Traceback (most recent call last):
... lines in my program which you really don't care about ...
File "/usr/lib64/python2.7/site-packages/scitools/aplotter.py", line 573,
in plot
r = p.plot_double(args[0],args[1],**limit_flags)
File "/usr/lib64/python2.7/site-packages/scitools/aplotter.py", line 501,
in plot_double
self.plot_labels(output_buffer, plot_data)
File "/usr/lib64/python2.7/site-packages/scitools/aplotter.py", line 345,
in plot_labels
output_buffer[min_x_coord+i][y_zero_coord-1] = c
IndexError: list assignment index out of range

What version of the product are you using? On what operating system?
python-scitools-0.9.0-2.1.4
On Slackware 64 1.4.1

Please provide any additional information below.
(1) A similar bug has been reported in
https://code.google.com/p/scitools/issues/detail?id=27
(2) On my particular data, adding
if y_zero_coord <= -len(output_buffer[0]):
y_zero_coord = -len(output_buffer[0]) + 1
right after line 330:
y_zero_coord = self.get_coord(0, plot_data.min_y, plot_data.y_step)
kludges around the problem, but I'm pretty sure that's not The Right
Thing
to do.
(3) y_zero_coord gets set to -20, and then subtracting 1 from that gives
-21,
which is an invalid list index in this case.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

scit...@googlecode.com

unread,
Feb 24, 2015, 7:01:14 AM2/24/15
to scitoo...@googlegroups.com
Updates:
Status: Fixed

Comment #1 on issue 34 by johannes...@gmail.com: scitools.aplotter.plot()
A fix is now available in the source repository.
Reply all
Reply to author
Forward
0 new messages