octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave-3.3.55 and Octave-3.3.90 on OSX


From: Ben Abbott
Subject: Re: Octave-3.3.55 and Octave-3.3.90 on OSX
Date: Sun, 30 Jan 2011 15:11:14 -0500

On Jan 30, 2011, at 3:01 PM, Richard Campbell wrote:

> On Jan 30, 2011, at 2:48 PM, Ben Abbott wrote:
> 
>> On Jan 30, 2011, at 1:10 PM, Richard Campbell wrote:
>> 
>>> On Jan 30, 2011, at 1:04 PM, John W. Eaton wrote:
>>> 
>>>> On 30-Jan-2011, Richard Campbell wrote:
>>>> 
>>>> | It's just a line plot. I pasted it in an earlier message in this thread. 
>>>> I get
>>>> | the same error when trying to print if I had typed surf(peaks) as well. 
>>>> It
>>>> | plots fine on the screen, I just can't print it to a file.
>>>> | 
>>>> | octave:1> plot(randn(10,1))
>>>> | octave:2> print('-dpng','test.png')
>>>> | warning: print.m: fig2dev binary is not available
>>>> | error: invalid assignment to cs-list outside multiple assignment
>>>> | error: matrix cannot be indexed with {
>>>> | error: evaluating argument list element number 3
>>>> | error: called from:
>>>> | error:   /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
>>>> line
>>>> | 390, column 11
>>>> | octave:2> print('-depsc','test.eps')
>>>> | error: invalid assignment to cs-list outside multiple assignment
>>>> | error: matrix cannot be indexed with {
>>>> | error: evaluating argument list element number 3
>>>> | error: called from:
>>>> | error:   /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
>>>> line
>>>> | 390, column 11
>>>> | octave:2> print('-dtiff','test.tiff')
>>>> | error: invalid assignment to cs-list outside multiple assignment
>>>> | error: matrix cannot be indexed with {
>>>> | error: evaluating argument list element number 3
>>>> | error: called from:
>>>> | error:   /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
>>>> line
>>>> | 390, column 11
>>>> | 
>>>> 
>>>> In 3.3.90, line 390 of print.m is
>>>> 
>>>> ## restore modified properties
>>>> if (isstruct (props))
>>>>   for n = 1:numel(props)
>>>>     if (ishandle (props(n).h))
>>>>       set (props(n).h, props(n).name, props(n).value{1});  <<< line 390
>>>>     endif
>>>>   endfor
>>>> endif
>>>> 
>>>> Try this in Octave:
>>>> 
>>>> dbstop print 390
>>>> peaks
>>>> print ('-depsc', 'test.eps')
>>>> 
>>>> then when you get the "debug>" prompt, try looking at the following
>>>> items:
>>>> 
>>>> numel (props)
>>>> props
>>>> props(1)
>>>> props(2)
>>>> 
>>>> Here is what I see:
>>>> 
>>>> debug> numel (props)
>>>> ans =  2
>>>> debug> props
>>>> props =
>>>> 
>>>> 1x2 struct array containing the fields:
>>>> 
>>>>   h
>>>>   name
>>>>   value
>>>> 
>>>> debug> props(1)
>>>> ans =
>>>> 
>>>> scalar structure containing the fields:
>>>> 
>>>>   h =  1
>>>>   name = position
>>>>   value = 
>>>>   {
>>>>     [1,1] =
>>>> 
>>>>        300   200   560   420
>>>> 
>>>>   }
>>>> 
>>>> debug> props(2)
>>>> ans =
>>>> 
>>>> scalar structure containing the fields:
>>>> 
>>>>   h =  1
>>>>   name = color
>>>>   value = 
>>>>   {
>>>>     [1,1] =
>>>> 
>>>>        1   1   1
>>>> 
>>>>   }
>>>> 
>>>> I guess you don't have the same props(?).value.  If not, then why is
>>>> it not set correctly?  You can do
>>>> 
>>>> dbstop print
>>>> peaks
>>>> print ('-depsc', 'test.eps')
>>>> 
>>>> and then step through print.m with dbstep to see where  props(?).value
>>>> is set.  Note that after you type a command at the debug prompt,
>>>> pressing the Enter by itself will repeat the previous command, so
>>>> stepping is easy.
>>>> 
>>>> jwe
>>> 
>>> 
>>> octave:1> dbstop print 390
>>> ans =  390
>>> octave:2> peaks
>>> octave:3> print('-depsc', 'test.eps');
>>> warning: print.m: fig2dev binary is not available
>>> error: invalid assignment to cs-list outside multiple assignment
>>> stopped in /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
>>> line 390
>>> 390:           set (props(n).h, props(n).name, props(n).value{1});
>>> debug> numel(props)
>>> ans =  2
>>> debug> props
>>> props =
>>> 
>>> 1x2 struct array containing the fields:
>>> 
>>>  h
>>>  name
>>>  value
>>> 
>>> debug> props(1)
>>> ans =
>>> 
>>> scalar structure containing the fields:
>>> 
>>>  h =  1
>>>  name = position
>>>  value = 
>>>  {
>>>    [1,1] =
>>> 
>>>       300   200   560   420
>>> 
>>>  }
>>> 
>>> debug> props(2)
>>> ans =
>>> 
>>> scalar structure containing the fields:
>>> 
>>>  h =  1
>>>  name = [](0x0)
>>>  value = [](0x0)
>>> 
>>> 
>>> and then while dbstepping through print.m:
>>> 
>>> debug> dbstep
>>> stopped in /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
>>> line 297
>>> 297:     props(2).h = opts.figure;
>>> debug> dbstep
>>> stopped in /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
>>> line 298
>>> 298:     props(2).name = "color";
>>> debug> dbstep
>>> error: invalid assignment to cs-list outside multiple assignment
>>> stopped in /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
>>> line 387
>>> 387:     if (isstruct (props))
>> 
>> props(2) is the problem.  Lines 297-300 set the name and value.
>> 
>> 297     props(2).h = opts.figure;
>> 298     props(2).name = "color";
>> 299     props(2).value{1} = get (props(2).h, props(2).name);
>> 300     set (props(2).h, props(2).name, "none");
>> 
>> I don't see how these fields end up empty. 
>> 
>> Please add another breakpoint at line 300, and check that the fields of 
>> props(2). Also check the fields of "opt". You can see the result I get below.
>> 
>> dbstop print 300
>> ans =  300
>> peaks
>> print ('-depsc', 'test.eps');
>> stopped in /Users/bpabbott/Development/Octave_Toolbox/print/print.m at line 
>> 300
>> 300: set (props(2).h, props(2).name, "none"); 
>> debug> props(2)
>> ans =
>> 
>> scalar structure containing the fields:
>> 
>>   h =  1
>>   name = color
>>   value = 
>>   {
>>     [1,1] =
>> 
>>        1   1   1
>> 
>>   }
>> 
>> debug> opts
>> opts =
>> 
>> scalar structure containing the fields:
>> 
>>   append_to_file = 0
>>   canvas_size =
>> 
>>      576   432
>> 
>>   debug = 0
>>   debug_file = octave-print-commands.log
>>   devopt = epsc
>>   epstool_binary = /sw/bin/epstool
>>   figure =  1
>>   fig2dev_binary = /sw/bin/fig2dev
>>   fontsize = 
>>   font = 
>>   force_solid = 0
>>   formatted_for_printing = 0
>>   ghostscript =
>> 
>>     scalar structure containing the fields:
>> 
>>       binary = /sw/bin/gs
>>       debug = 0
>>       device = 
>>       epscrop =  1
>>       level = [](0x0)
>>       output = 
>>       papersize = 
>>       pageoffset =
>> 
>>          0   0
>> 
>>       resolution =  150
>>       antialiasing = 0
>> 
>>   loose = 0
>>   lpr_binary = /usr/bin/lpr
>>   name = test.eps
>>   orientation = portrait
>>   pstoedit_binary = /sw/bin/pstoedit
>>   preview = 
>>   printer = 
>>   send_to_printer = 0
>>   special_flag = textnormal
>>   tight_flag = 0
>>   use_color =  1
>>   lpr_options = -l
>>   unlink = {}(0x0)
>>   pstoedit_cmd = @pstoedit
>>   fig2dev_cmd = @fig2dev
>>   latex_standalone = @latex_standalone
>>   lpr_cmd = @lpr
>>   epstool_cmd = @epstool
>> 
>> Ben
> 
> dbstop print 300 has no effect, which tells me that the line is never being 
> executed.
> 
> dbstop print 297 stops as expected, though. If I step forward from there:
> 
> octave:1> peaks
> octave:2> dbstop print 297
> ans =  297
> octave:3> print('-depsc','test.eps')
> warning: print.m: fig2dev binary is not available
> stopped in /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
> line 297
> 297:     props(2).h = opts.figure;
> debug> dbstep
> stopped in /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
> line 298
> 298:     props(2).name = "color";
> debug> dbstep
> error: invalid assignment to cs-list outside multiple assignment
> stopped in /Users/campbell/Downloads/octave-3.3.90/scripts/plot/print.m at 
> line 387
> 387:     if (isstruct (props))


Hopefully, John has some insight here (I don't). It looks to me like lines 
298-377 never run, or the debugger is lost.

Can you confirm that test.eps wasn't created?

Ben





reply via email to

[Prev in Thread] Current Thread [Next in Thread]