bugGNU Octave - Bugs: bug #51759, demo ("axis", 3) fails...

 
 

bug #51759: demo ("axis", 3) fails with gnuplot

Submitted by:  Avinoam Kalma <avinoam>
Submitted on:  Tue 15 Aug 2017 06:11:28 PM UTC  
 
Category: Plotting with gnuplotSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Microsoft Windows

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)

Wed 23 Aug 2017 10:22:57 PM UTC, comment #10:

I pushed your cset here (http://hg.savannah.gnu.org/hgweb/octave/rev/fe780a4b89c1). It's true, I prefer to avoid for loops so I used the version with repmat. Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Wed 23 Aug 2017 05:39:06 AM UTC, comment #9:

The construct I wrote is intended. That's the "if labels is empty" part. Bit of a trick I suppose since it incorporates the conditional in the syntax.

is the same as

or

The bug is that labels can't be empty or the loop will fail.

The preference for patch 41540 or 41542 is up to you. I know you like to get rid of loops whenever possible, so I thought you might like 41542.

Dan Sebald <sebald>
Wed 23 Aug 2017 05:12:32 AM UTC, comment #8:

For Matlab compatibility, axis labels should repeat. The motivating example in comment #5 works for me already. Ticklabels are correctly repeated even without this patch. I don't know why that is, but I'm happy to commit the patch if it fixes problems for others.

Could you take a look at this line

Why use a range here? Why not

Rik <rik5>
Project Administrator
Sat 19 Aug 2017 06:25:44 PM UTC, comment #7:

Changing status to to "Patch Reviewed".

@Maintainers: Please push the patch

Avinoam Kalma <avinoam>
Project Member
Fri 18 Aug 2017 05:03:33 AM UTC, comment #6:

Last patch also fixes this problem. Thanks!

Avinoam Kalma <avinoam>
Project Member
Wed 16 Aug 2017 04:22:24 PM UTC, comment #5:

Oh, an example for comparison in the most general case:

Dan Sebald <sebald>
Wed 16 Aug 2017 04:20:14 PM UTC, comment #4:

If one prefers compactness of code and removing the conditional test on k, here's another patch that uses repmat() to repeat labels.

(file #41542)

Dan Sebald <sebald>
Wed 16 Aug 2017 04:08:59 PM UTC, comment #3:

Regarding the repetition of labels, i.e., resetting k. I was thinking about this a bit. Perhaps the wrap is intended; say, something like:

So, just to make the wrap behavior consistent with FLTK/Qt toolkits, I'm attaching a new patch that simple adds one blank label if there are no labels.

(file #41540)

Dan Sebald <sebald>
Wed 16 Aug 2017 10:48:24 AM UTC, comment #2:

Thank you very much for the fix. This patch solves the problem.
I checked it with "compare_plot_demos" and I did not see new
problems.

@maintainers: Please push this patch

Avinoam Kalma <avinoam>
Project Member
Wed 16 Aug 2017 06:35:35 AM UTC, comment #1:

I see the error, but Octave isn't freezing on my linux machine. (I don't quite have the latest code because compiling is failing here at the moment.) Typically the gnuplot toolkit pipe gets out of synch with this type of error.

Try the attached patch. It supplies missing labels as empty strings. This seems to the most code efficient way of doing things.

Rik, can you think of any reason that the index k (in the patch) should wrap around to the front and start repeating labels? I would think that simply leaving the last ones blank is the better result.

Also, the error message gives array notation

labels(1): out of bound 0

when labels was indexed as a cell, i.e., labels{k++}. My first instinct was to grep for "labels(" or "labels (". It didn't take long to figure out "labels{" was the syntax to search for. It might be convenient for the user to see round or curly bracket depending on the use that caused the error.

(file #41539)

Dan Sebald <sebald>
Tue 15 Aug 2017 06:11:28 PM UTC, original submission:

After the second command, Octave hangs.

Avinoam Kalma <avinoam>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by sebald (Updated the item)
  • -unavailable- added by avinoam (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Aug 2017 10:22:57 PM UTCrik5StatusPatch Reviewed=>Fixed
      Open/ClosedOpen=>Closed
    Sat 19 Aug 2017 07:06:38 PM UTCavinoamStatusPatch Submitted=>Patch Reviewed
    Wed 16 Aug 2017 04:20:14 PM UTCsebaldAttached File-=>Added octave-missing_gnuplot_axis_labels_remove_k_loop-djs2017aug16.patch, #41542
    Wed 16 Aug 2017 04:08:59 PM UTCsebaldAttached File-=>Added octave-missing_gnuplot_axis_labels_smallest_code_change-djs2017aug16.patch, #41540
    Wed 16 Aug 2017 10:49:08 AM UTCavinoamStatusNone=>Patch Submitted
      Operating SystemAny=>Microsoft Windows
    Wed 16 Aug 2017 06:35:35 AM UTCsebaldAttached File-=>Added octave-missing_gnuplot_axis_labels-djs2017aug16.patch, #41539

    Back to the top


    Powered by Savane 3.1-cleanup1