bugGNU Octave - Bugs: bug #31991, only last legend displayed when...

 
 

bug #31991: only last legend displayed when putting titles in the plot() command

Submitter:  None
Submitted:  Mon 27 Dec 2010 02:19:16 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  indium Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.3.54
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 18 Jan 2011 12:28:17 PM UTC, comment #9: 

I'm changing the status to fixed and closing this item. If a needed it can be reopened.

Ben Abbott <bpabbott>
Group Member
Sat 08 Jan 2011 03:13:17 PM UTC, comment #8: 
Ben Abbott <bpabbott>
Group Member
Sat 08 Jan 2011 12:10:21 AM UTC, comment #7: 

When plotting with more than 2 legends, there was a remaining error :

error: horizontal dimensions mismatch (2x1 vs 1x1) near line 135, column 26
error: called from:
error:   /usr/local/octave-3.3.54/share/octave/3.3.54/m/plot/private/__plt__.m at line 135, column 13

which appears to be solved by the attached patch


(file #22375)

John Hunt <huntj>
Tue 28 Dec 2010 10:43:19 PM UTC, comment #6: 

I've pushed the change and changed the status.

http://hg.savannah.gnu.org/hgweb/octave/rev/a451eb6f92b2


Ben Abbott <bpabbott>
Group Member
Tue 28 Dec 2010 07:52:16 PM UTC, comment #5: 

Of course you're right that hlgnd is needed, and the current code should work if there is only one line using the old octave legend styles. Your changes looks correct that the old code looks like a thinko when extracting the code in _plt_key_ into a subfunction to remove code duplication. Go ahead and push your second changeset

D.

David Bateman <dbateman>
Group Member
Tue 28 Dec 2010 07:06:52 PM UTC, comment #4: 

David,

It looks to me like the line object handles (hlgnd) are needed in case legend keys are not included for each of line object.

The 1st demo for legend() is an example.

Does this make sense, or am I missing something?

Ben

Ben Abbott <bpabbott>
Group Member
Tue 28 Dec 2010 02:49:08 PM UTC, comment #3: 

The code in _plt_.m(_plt_key_) just looks wrong as it stands as I see no use of hlgnd. So I'd say push your change

D.

David Bateman <dbateman>
Group Member
Tue 28 Dec 2010 12:47:41 PM UTC, comment #2: 

I've added a new demo to legend.m that would not work correctly with my 1st changeset. A second changeset is attached.

To test this change, type ...


demo ("legend", 1)


(file #22308)

Ben Abbott <bpabbott>
Group Member
Tue 28 Dec 2010 02:12:28 AM UTC, comment #1: 

I assume in inline legend keys were broken when the legend was modified to be compatible with Matlab.

I've attached a changeset that seems to fix the problem for me.

In case he'd like to take a look or comment, I've cc'd David.

(file #22303)

Ben Abbott <bpabbott>
Group Member
Mon 27 Dec 2010 02:19:16 PM UTC, original submission:  

Dear all,

I have noticed that version 3.3.54 (compiled from source on Ubuntu 10.10) only plots the last legend when giving 'inline' titles in a multiple-plot command.

Below the example that is found in 'octave> doc plot'
This generates only 'sin(t)' as a legend in 3.3.54
(Same for gnuplot or fltk)
This problem doesn't occur for version 3.2.3 (gnuplot).
 

octave:11> t = 0:0.1:6.3;
octave:12>           plot (t, cos(t), "-;cos(t);", t, sin(t), "+3;sin(t);");
octave:13> version
ans = 3.3.54


best regards,

indium

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #22375:  __plt__.m.patch added by huntj (311B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by huntj (Updated the item)
  • -email is unavailable- added by dbateman (Posted a comment)
  • -email is unavailable- added by bpabbott (Updated the item)
  • -email is unavailable- added by bpabbott
  • -email is unavailable- added by None (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
    2011-01-18 bpabbott StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2011-01-08 huntj Attached File- Added _plt_.m.patch, #22375
    2010-12-28 bpabbott Item GroupNone Incorrect Result
        StatusPatch Submitted Ready For Test
        Assigned toNone bpabbott
    2010-12-28 bpabbott Attached File- Added changeset.patch, #22308
    2010-12-28 bpabbott Attached File- Added changeset.patch, #22303
        StatusNone Patch Submitted
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code