Menu

#323 Problems with bar plots when a table contains only one row with X,Y data

next
open
nobody
None
4normal
2018-09-30
2018-01-12
Fellype
No

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.

2 Attachments

Discussion

  • Fellype

    Fellype - 2018-01-12
    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,2 @@
     bar_plot_from_multiple_tables-created_with_LINUX_build.sciprj (6.9 kB; application/x-sciprj)
    +bar_plot_from_multiple_tables-created_with_windows_build.sciprj (6.9 kB; application/x-sciprj)
    
     
  • High Performance Coder

    I don't get a crash. Using scidavis-1.22 for OpenSUSE Tumbleweed.

     
    • Fellype

      Fellype - 2018-01-15

      This screenshot you attached is not of a bar plot.

       
      • High Performance Coder

        On Mon, Jan 15, 2018 at 01:45:10PM -0000, Fellype wrote:

        This screenshot you attached is not of a bar plot.

        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


         
  • Alexander Ploumistos

    Can't reproduce it either. I'm using 1.22 on Fedora 27, x86_64.

     
  • gbm

    gbm - 2018-01-15

    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.

     
    • Fellype

      Fellype - 2018-01-16

      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.

       
  • Fellype

    Fellype - 2018-01-16

    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.

     
  • gbm

    gbm - 2018-01-16

    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.

     
  • High Performance Coder

    • Group: 1.22 --> next
     

Log in to post a comment.