#2691 plot2d style broken in 5.32

None
wont-fix
5
2014-06-28
2014-02-23
zigarrre
No

The style option in (wx)plot2d has accepted empty brackets [] before to use the default style for that element. Since version 5.32 this doesn't work anymore.

This feature is very useful if you i.e. want to plot multiple functions and some point, because the different colors for the functions don't need to be set manually.

A minimal example:
wxplot2d([x^2,[discrete,[[2,20]]]],[x,0,10],[style,[],[points,1,2,4]]);

This code works with version 5.31.0 but fails with 5.32.1.

The error message is:
Wrong argumet [] for option style. Not a valid style.
-- an error. To debug this try: debugmode(true);

As this was working in older versions I consider this behavior a bug.

My Platform is x86-64 with Arch Linux.

Discussion

  • Hi,
    thanks for your message. Versions previous to 5.32 did not check the options given to plot2d and in some cases that led to unexpected errors. 5.32 introduced a new function to check plot options.
    Since the [style,[]] hack that you used was not documented, I do not consider it a bug; however, I will regard it as a new feature request: implementation of a way to ask for default values.
    Passing an empty list to get the default value seems to me very odd. Perhaps it would be better to accept a keyword such as "default"? Any other ideas?

    Best regards,
    Jaime

     
    • labels: bug --> bug, plotting
    • assigned_to: Jaime E. Villate
     
  • Robert Dodier
    Robert Dodier
    2014-06-28

    Thanks for taking the time to make a report. I'm closing this report as "wont-fix" since it is not a bug.

     
  • Robert Dodier
    Robert Dodier
    2014-06-28

    • status: open --> wont-fix