bugGNU Octave - Bugs: bug #41944, For bar charts with...

 
 

bug #41944: For bar charts with yscale="log" -> basevalue = 1

Submitter:  Ben Abbott <bpabbott>
Submitted:  Mon 24 Mar 2014 01:04:49 PM UTC
   
 
Category:  Plotting Severity:  2 - Minor
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Ben ABbott Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 22 Dec 2016 11:39:50 PM UTC, comment #9: 

I checked in an extension of the proposed patch which silences the ugly warnings (http://hg.savannah.gnu.org/hgweb/octave/rev/f2d2edab5c66).  Closing report.

Rik <rik5>
Group administrator
Sun 18 Dec 2016 07:48:16 PM UTC, comment #8: 

I've tested Rik's patch from comment #7 in an Octave built from the current dev branch (hg-id b150be19734d). The resulting log bar plot looks fine to me, I will attach a screenshot. But I do see a lot of warnings (as expected by Rik) when running the script from comment #1:

>> bar_log

linear: basevalue = 0.00
warning: axis: omitting non-positive data in log plot
warning: called from
    bar_log at line 9 column 1
warning: axis: omitting non-positive data in log plot
warning: called from
    __bar__>move_baseline at line 431 column 7
    __bar__>update_basevalue_logscale at line 369 column 7
    bar_log at line 9 column 1
warning: axis: omitting non-positive data in log plot
warning: called from
    __bar__>update_data at line 477 column 11
    __bar__>move_baseline at line 434 column 9
    __bar__>update_basevalue_logscale at line 369 column 7
    bar_log at line 9 column 1
warning: axis: omitting non-positive data in log plot
warning: called from
    __bar__>update_data at line 477 column 11
    __bar__>move_baseline at line 434 column 9
    __bar__>update_basevalue_logscale at line 369 column 7
    bar_log at line 9 column 1
log: basevalue = 1.00
>>

Could we silence those warnings for this use case somehow?


Hartmut <hardy>
Thu 15 Dec 2016 09:40:22 PM UTC, comment #7: 

Try the attached patch on dev.  It throws a lot of warnings about negative values on log plots, but it does produce the right plot and basevalue outputs.

(file #39244)

Rik <rik5>
Group administrator
Thu 15 Dec 2016 02:18:30 PM UTC, comment #6: 

This issue is still present in Octave 4.2.0.

The demo script from comment #1 still produces a wrong log bar plot.

Hartmut <hardy>
Tue 25 Mar 2014 03:07:19 AM UTC, comment #5: 

With basevalue = -1 and yscale = 'log', the bar chart doesn't display correctly and gives the error below.


Warning: Negative data ignored


The public bar chart properties are below.


    Annotation
    DisplayName
    HitTestArea
    BeingDeleted
    ButtonDownFcn
    Children
    Clipping
    CreateFcn
    DeleteFcn
    BusyAction
    HandleVisibility
    HitTest
    Interruptible
    Parent
    SelectionHighlight
    Tag
    Type
    UIContextMenu
    UserData
    Selected
    Visible
    XData
    XDataMode
    XDataSource
    YData
    YDataSource
    BaseValue
    BaseLine
    BarLayout
    BarWidth
    Horizontal
    LineWidth
    EdgeColor
    FaceColor
    LineStyle
    ShowBaseLine


Ben Abbott <bpabbott>
Group Member
Tue 25 Mar 2014 01:09:31 AM UTC, comment #4: 

I suppose you could try


get (h(1))


and sift through the properties to see if there is anything with 'basevalue' in the name.  I checked the documentation and it isn't there for the bar series object.

Did the bar chart with -1 basevalue display correctly with a log axis?

Rik <rik5>
Group administrator
Tue 25 Mar 2014 12:12:13 AM UTC, comment #3: 

The results are below.


ans =

    -1

ans =

    -1


Does that imply that the bar() has an private "basevaluemode" property?

Ben Abbott <bpabbott>
Group Member
Mon 24 Mar 2014 10:55:34 PM UTC, comment #2: 

Is this as simple as adding a listener in private/__bar__.m on the y-axis that resets the basevalue when the scale changes from linear to log?  Or should we be doing something better?

Does Matlab change the basevalue even when it has been modified by the user?  Does it change it back if you switch to 'linear' again?


h = bar (rand (3));
set (h, 'basevalue', -1);
set (gca, 'yscale', 'log');
get (h(1), 'basevalue')
set (gca, 'yscale', 'linear');
get (h(1), 'basevalue')


Rik <rik5>
Group administrator
Mon 24 Mar 2014 01:09:14 PM UTC, comment #1: 

I've attached a simple script (which can be modified and used as a demo).  The resulting plot and console output from Matlab are attached.


linear: basevalue = 0.00
log: basevalue = 1.00


(file #31022, file #31023)

Ben Abbott <bpabbott>
Group Member
Mon 24 Mar 2014 01:04:49 PM UTC, original submission:  

For log-scale bar charts Matlab sets the basevalue to 1 (for linear the basevalue = 0).

Presently Octave sets the basevalue to zero in each case.

Ben Abbott <bpabbott>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #39244:  basevalue.patch added by rik5 (1KiB - application/x-download)
file #31022:  bar_log.m added by bpabbott (275B - application/octet-stream)
file #31023:  bar_log.pdf added by bpabbott (4KiB - application/pdf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by bpabbott (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-22 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2016-12-18 hardy Attached File- Added log_bar_Octave403+_withPatch.png, #39269
    2016-12-15 rik5 Attached File- Added basevalue.patch, #39244
        Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        StatusNeed Info Ready For Test
    2014-03-24 rik5 StatusNone Need Info
    2014-03-24 bpabbott Attached File- Added bar_log.m, #31022
        Attached File- Added bar_log.pdf, #31023

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code