On Linux:
If you try to create a bar plot from a table with only one row with X,Y data SciDAVis crashes.
The crashes also occurs:
- if you delete data from a table in order to leave only one row with a X,Y pair
- if you try to add (using Alt + C) to an existing graph with bar plot another bar from a table with only one row with X,Y data
the terminal output is:
ASSERT failure in QVector<T>::operator[]: "index out of range", file /usr/lib/qt/include/QtCore/qvector.h, line 355
Aborted
What occurs on Windows is a little bit more difficult to describe:
Try to add (using Alt + C) to an existing graph with bar plot another bar from a table with only one row with X,Y data, if the X value of the added bar is larger than that present in the existing graph the graph will be messy.
The problems occurs using both vertical and horizontal bars.
Diff:
I don't get a crash. Using scidavis-1.22 for OpenSUSE Tumbleweed.
This screenshot you attached is not of a bar plot.
On Mon, Jan 15, 2018 at 01:45:10PM -0000, Fellype wrote:
Sorry about that. I don't know what happened to the actual screenshot
I saved...
--
Dr Russell Standish Phone 0425 253119 (mobile)
Principal, High Performance Coders
Visiting Senior Research Fellow hpcoder@hpcoders.com.au
Economics, Kingston University http://www.hpcoders.com.au
Can't reproduce it either. I'm using 1.22 on Fedora 27, x86_64.
I don't get a crash, either (Fedora, current git code).
The ASSERT failure you get points to an 'out of range' error.
Checking the code for bar plots I found some possible 'out of range' bugs.
Try attached patch.
Dear gbm,
The patch you provided fix the crashes here (on Slackware 14.2).
Now the current issue is reduced only to the second part - the messy graphs.
Best regards.
BTW,
The crashes looks to affect only Slackware builds (both 32 and 64 bits). I've tested it on Ubuntu 16.04 with no crashes. But the problem with messy graphs occurs.
The SciDAVis code for vertical bar plots gets the bar width for a plot curve by calculating the minimum of the x-coordinate difference between consecutive curve points (i.e. consecutive rows in table).
For a curve with only one row (point), there is no way to obtain that minimum, and the abs(x-coordinate) of the single point is taken as bar width.
Unless a global bar width is implemented I don't see a better way to obtain the bar width for a one point curve.