Reformatting graphics demos

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Reformatting graphics demos

John W. Eaton
Administrator
I just noticed this change:

o  changeset:   22566:1c4cd12987f5
|  user:        Rik <[hidden email]>
|  date:        Mon Aug 15 15:15:30 2016 -0700
|  summary:     Use Octave syntax in graphics demos.

I prefer Octave syntax as well, but I thought we used Matlab-compatible
syntax for those demos so it would be possible to run them in Matlab and
easily compare the appearance of plots.  Is that no longer a goal?
Sorry if I missed a discussion about this.

jwe

Reply | Threaded
Open this post in threaded view
|

Re: Reformatting graphics demos

bpabbott
Administrator
> On Aug 15, 2016, at 7:21 PM, John W. Eaton <[hidden email]> wrote:
>
> I just noticed this change:
>
> o  changeset:   22566:1c4cd12987f5
> |  user:        Rik <[hidden email]>
> |  date:        Mon Aug 15 15:15:30 2016 -0700
> |  summary:     Use Octave syntax in graphics demos.
>
> I prefer Octave syntax as well, but I thought we used Matlab-compatible syntax for those demos so it would be possible to run them in Matlab and easily compare the appearance of plots.  Is that no longer a goal? Sorry if I missed a discussion about this.
>
> jwe

I also thought the agreement was to use Matlab syntax for graphics demos.  For example, from 3 weeks ago ;-)

        http://hg.savannah.gnu.org/hgweb/octave/rev/283d8dfcad37

# HG changeset patch
# User Rik <[hidden email]>
# Date 1469030091 25200
# Node ID 283d8dfcad373b2c11e2aa76e66a58b4a17a3dbc
# Parent  c4901d7a2d7dcdc0a2d057748f603f06ce62731d
Make demos Matlab compatible for comparison with dump_demos script.

However, the above changeset isn’t consistent with applying Matlab syntax. Example, the demos often use double-quotes, which Matlab doesn’t support.

Ben



Reply | Threaded
Open this post in threaded view
|

Re: Reformatting graphics demos

Rik-4


On Mon, August 15, 2016 7:54 pm, Ben Abbott wrote:

>> On Aug 15, 2016, at 7:21 PM, John W. Eaton <[hidden email]> wrote:
>>
>> I just noticed this change:
>>
>> o  changeset:   22566:1c4cd12987f5
>> |  user:        Rik <[hidden email]>
>> |  date:        Mon Aug 15 15:15:30 2016 -0700
>> |  summary:     Use Octave syntax in graphics demos.
>>
>> I prefer Octave syntax as well, but I thought we used
>> Matlab-compatible syntax for those demos so it would be possible to
>> run them in Matlab and easily compare the appearance of plots.  Is
>> that no longer a goal? Sorry if I missed a discussion about this.
>>
>> jwe
>
> I also thought the agreement was to use Matlab syntax for graphics
> demos.  For example, from 3 weeks ago ;-)
>
> http://hg.savannah.gnu.org/hgweb/octave/rev/283d8dfcad37
>
> # HG changeset patch
> # User Rik <[hidden email]>
> # Date 1469030091 25200
> # Node ID 283d8dfcad373b2c11e2aa76e66a58b4a17a3dbc
> # Parent  c4901d7a2d7dcdc0a2d057748f603f06ce62731d
> Make demos Matlab compatible for comparison with dump_demos script.
>
> However, the above changeset isn?t consistent with applying Matlab
> syntax. Example, the demos often use double-quotes, which Matlab
> doesn?t support.
>
> Ben
>

The dump_demos.m script now includes a simple oct2mat converter.  It
takes care of double quotes / single quotes, comment characters ('#'
vs. '%'), and our extended end syntax (endif, endfunction, etc.).
This allows us to write the demos in ordinary Octave syntax.  The only
thing it doesn't handle is line continuations so those have to remain.

--Rik



Reply | Threaded
Open this post in threaded view
|

Re: Reformatting graphics demos

Andreas Weber-6
Am 16.08.2016 um 02:48 schrieb Rik:

> The dump_demos.m script now includes a simple oct2mat converter.  It
> takes care of double quotes / single quotes, comment characters ('#'
> vs. '%'), and our extended end syntax (endif, endfunction, etc.).
> This allows us to write the demos in ordinary Octave syntax.  The only
> thing it doesn't handle is line continuations so those have to remain.

Another thing what currently causes problems when run in Matlab is

x += y

for example in "demo contrast". There isn't a replacement in the simple
oct2mat yet.
-- Andy