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

 
 

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

Submitted by:  None
Submitted on:  Mon 27 Dec 2010 02:19:16 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Ben Abbott <bpabbott>
Originator Name: indiumOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.3.54
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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>
Project MemberIn charge of this item.
Sat 08 Jan 2011 03:13:17 PM UTC, comment #8:

I've pushed your patch.

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

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project 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>
Project MemberIn charge of this item.
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>
Project 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 ...

(file #22308)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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).

best regards,

indium

Anonymous

 

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

Attach File(s):
   
   
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
  • -unavailable- added by huntj (Updated the item)
  • -unavailable- added by dbateman (Posted a comment)
  • -unavailable- added by bpabbott (Updated the item)
  • -unavailable- added by bpabbott
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 18 Jan 2011 12:28:17 PM UTCbpabbottStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 08 Jan 2011 12:10:21 AM UTChuntjAttached File-=>Added _plt_.m.patch, #22375
    Tue 28 Dec 2010 10:43:19 PM UTCbpabbottItem GroupNone=>Incorrect Result
      StatusPatch Submitted=>Ready For Test
      Assigned toNone=>bpabbott
    Tue 28 Dec 2010 12:47:41 PM UTCbpabbottAttached File-=>Added changeset.patch, #22308
    Tue 28 Dec 2010 02:12:28 AM UTCbpabbottAttached File-=>Added changeset.patch, #22303
      StatusNone=>Patch Submitted
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1