Thu 11 Jul 2013 08:17:24 PM UTC, comment #9:
Okay, that seems to work correctly now. Closing this issue again.
|
Thu 11 Jul 2013 06:07:27 PM UTC, comment #8:
Good catch! It seems that the code does not call _next_line_color_(0) in this case but assumes this to be the default behavior.
I added a line to each file which mimics this default behavior. I'm still fumbling a bit with mercurial but hopefully my attached patch will work for you.
(file #28546)
|
Thu 11 Jul 2013 04:39:47 PM UTC, comment #7:
Carl, could you take another look at your solution. It is failing to change the colors for multiple plots done into a single axis.
The following code should produce a blue line and a green line. Instead both lines are blue.
|
Wed 10 Jul 2013 01:54:52 AM UTC, comment #6:
Thanks for your work in solving this. I committed your change here (http://hg.savannah.gnu.org/hgweb/octave/rev/0dab17e69a55). You can see the change by building from Mercurial sources or wait until the next major release (3.8) of Octave. Closing report.
|
Mon 08 Jul 2013 03:49:58 PM UTC, comment #5:
Hi Rik,
Sorry I wasn't aware of the Contributing Guidelines but I will certainly follow them in the future. I want to make it as easy as possible to share my bug fixes so we can all enjoy a better program.
A coworker ran the spectrum_test.m on Matlab 7.14.0.739 (R2012a) and I've posted the result. In this case it's not as busted as Octave. :)
Thanks!
-Carl
(file #28513)
|
Tue 02 Jul 2013 11:41:33 PM UTC, comment #4:
I took a look at the patch and it generally looks fine. You might want to look at the chapter in the manual titled "Contributing Guidelines". We have a number of conventions that we use for m-files such as using '##' instead of '%' for comments or surrounding the test clauses in if statements with parentheses. I can modify it pretty easily, but if you get in the habit of contributing it will make it easier on the few of us available for triaging bugs if we can just apply the patch without modification.
Also, just to be sure, I'd like to have someone run spectrum_test.m on Matlab and upload the resulting png file. It may be that Matlab is just as busted and does not maintain a separate ColorOrder for each subplot axis.
|
Wed 26 Jun 2013 05:13:43 PM UTC, comment #3:
A little more explanation:
The original code used persistent variables to keep track of the ColorOrder and color_index within that order. These variables were shared among all plots so they would interfere with each other and an individual plot would not follow its assigned ColorOrder. Also, the persistent ColorOrder did not always match with the actual ColorOrder assigned to the current plot.
The included patch reads the ColorOrder property for the current axes and calculates the color_index (and style_index) based on the number of children in that axes. This is independent of any other plots and provides a consistent and predictable result.
|
Wed 26 Jun 2013 11:15:18 AM UTC, comment #2:
Sorry, my mistake. spectrum_test is:
|
Wed 26 Jun 2013 01:37:22 AM UTC, comment #1:
The spectrum-test.m file is empty. Could you re-upload the file?
|
Tue 25 Jun 2013 07:02:53 PM UTC, original submission:
The attached patch fixes a few problems with using "hold all" over multiple plots. This allows families of related plots to share a common color and style legend.
Please see the attached before and after plots produced by the attached "spectrum_test.m" script.
Please let me know if you have any trouble.
|