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.
|
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.
|
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
|
Sat 19 Aug 2017 06:25:44 PM UTC, comment #7:
Changing status to to "Patch Reviewed".
@Maintainers: Please push the patch
|
Fri 18 Aug 2017 05:03:33 AM UTC, comment #6:
Last patch also fixes this problem. Thanks!
|
Wed 16 Aug 2017 04:22:24 PM UTC, comment #5:
Oh, an example for comparison in the most general case:
|
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)
|
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)
|
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
|
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)
|
Tue 15 Aug 2017 06:11:28 PM UTC, original submission:
After the second command, Octave hangs.
|