[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with ginput
From: |
Ben Abbott |
Subject: |
Re: Problem with ginput |
Date: |
Thu, 10 Dec 2009 09:11:01 -0500 |
On Thursday, December 10, 2009, at 08:48AM, "Matthias Brennwald"
<address@hidden> wrote:
>
>On Dec 10, 2009, at 1:26 PM, Ben Abbott wrote:
>
>> On Dec 10, 2009, at 2:19 AM, Matthias Brennwald wrote:
>>
>>> On Dec 9, 2009, at 1:53 PM, Ben Abbott wrote:
>>>
>>>>> Dear all
>>>>>
>>>>> I have a problem using the ginput command with Octave 3.2.3 on Windows
>>>>> XP (I did the same on a Mac running Mac OS X, where everything worked
>>>>> as expeced). Using ginput results in warnings and never returns any
>>>>> result. Here's an example:
>>>>>
>>>>> --------------
>>>>> octave.exe:5:~\Desktop
>>>>>> gnuplot_binary
>>>>> ans = C:\Octave\3.2.3_gcc-4.4.0\bin\gnuplot.exe
>>>>> octave.exe:6:~\Desktop
>>>>>> version
>>>>> ans = 3.2.3
>>>>> octave.exe:7:~\Desktop
>>>>>> which ginput
>>>>> `ginput' is a function from the file C:\Octave\3.2.3_gcc-4.4.0\share
>>>>> \octave\packages\plot-1.0.7\ginput.m
>>>>> octave.exe:8:~\Desktop
>>>>>> plot (rand(1,10))
>>>>> octave.exe:9:~\Desktop
>>>>>> ginput (1)
>>>>> warning: implicit conversion from real matrix to real scalar
>>>>> warning: implicit conversion from real matrix to real scalar
>>>>> warning: implicit conversion from real matrix to real scalar
>>>>> warning: implicit conversion from real matrix to real scalar
>>>>> [THINGS SEEM TO BE STUCK HERE. THE ONLY WAY TO EXIT FROM GINPUT AT
>>>>> THIS POINT SEEMS TO BE CTRL-C.]
>>>>> --------------
>>>>>
>>>>> I don't know what to do to fix this. Is this a but or am I doing
>>>>> something in the wrong way? I'd appreciate any help.
>>>>>
>>>>> Matthias
>>>>
>>>> Matthias, can you tell us what version of gnuplot you're using? You can
>>>> get that info by type "__gnuplot_version__" at Octave's prompt.
>>>>
>>>> I don't have a windows machine to test this on, but this problem may have
>>>> been fixed.
>>>>
>>>> The prior discussion is at this link.
>>>>
>>>> http://old.nabble.com/Ginput-doesn't-work-in-3.2.3-to26470943.html
>>>>
>>>> The changeset is linked to below.
>>>>
>>>> http://hg.savannah.gnu.org/hgweb/octave/rev/fea3d4868692
>>>>
>>>> Can someone confirm this change fixed the problem?
>>>>
>>>> Ben
>>>
>>> Dear Ben, dear all
>>>
>>> I believe the above change to __go_draw_figure__.m does not fix my issue. I
>>> applied the change by hand (I don't know how to use the programs that were
>>> made for this...), but I still get the very same behavior from ginput().
>>> Maybe I did not apply the change properly. So:
>>>
>>> - Can someone send me a properly patched version of the file?
>>>
>>> - Can someone confirm if the ginput() issue does (not) occur on his/her
>>> setup (Windows XP, Octave 3.2.3 and gnuplot 4.3, downloaded from
>>> http://octave.sourceforge.net ).
>>>
>>> Thanks
>>> Matthias
>>
>> I have modified a version of __gnuplot_ginput__.m which inserts to "unset
>> multiplot" command into the gnuplot stream prior to asking for coordinates.
>> Please try using it on both your Mac and PC.
>>
>> Be sure to cd to the directories containing the modified version and try ...
>>
>> [x, y, m] = __gnuplot_ginput__ (gcf, 1)
>>
>> If it doesn't work, try to restore the path to its original default (in case
>> there is a conflict between an octave core function and a local one)
>>
>> restoredefaultpath
>> [x, y, m] = __gnuplot_ginput__ (gcf, 1)
>>
>> If it still doesn't work, try "debug_on_warning" to determine what line is
>> producing the warning.
>>
>> debug_on_warning
>> [x, y, m] = __gnuplot_ginput__ (gcf, 1)
>>
>> Ben
>
>I tried this on both my Mac and a Windows XP box. It worked without a flaw on
>the Mac, but not on Windows:
>
>-------------
>octave-3.2.3.exe:4:~\Desktop
>> plot(sin(1:10))
>octave-3.2.3.exe:5:~\Desktop
>> __gnuplot_ginput__(gcf,1)
>[HERE I TRIED CLICKING AND PRESSING KEYS ON THE FIGURE, BUT IT DID NOT EXIT
>UNTIL I HIT CTRL-C]
>octave-3.2.3.exe:5:~\Desktop
>> restoredefaultpath
>ans =
>C:\Octave\3.2.3_gcc-4.4.0\libexec\octave\3.2.3\site\oct\i686-pc-mingw32;C:\Octave\3.2.3_gcc-4.4.0\libexec\octave\site\oct\api-v37\i686-pc-mingw32;C:\Octave\3.2.3_gcc-4.4.0\libexec\octave\site\oct\i686-pc-mingw32;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\site\m;C:\Octave\3.2.3_gcc-4.4.0\share\octave\site\api-v37\m;C:\Octave\3.2.3_gcc-4.4.0\share\octave\site\m;C:\Octave\3.2.3_gcc-4.4.0\share\octave\site\m\startup;C:\Octave\3.2.3_gcc-4.4.0\libexec\octave\3.2.3\oct\i686-pc-mingw32;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\audio;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\deprecated;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\elfun;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\general;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\geometry;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\help;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\image;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\io;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\linear-algebra;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\miscellaneous;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\optimization;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\path;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\pkg;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\plot;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\polynomial;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\set;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\signal;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\sparse;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\specfun;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\special-matrix;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\startup;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\statistics;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\statistics\base;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\statistics\distributions;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\statistics\models;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\statistics\tests;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\strings;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\testfun;C:\Octave\3.2.3_gcc-4.4.0\share\octave\3.2.3\m\time
>octave-3.2.3.exe:6:~\Desktop
>> __gnuplot_ginput__(gcf,1)
>error: A(I) = X: X must have the same size as I
>error: called from:
>error: C:\Documents and Settings\Matthias
>Brennwald\Desktop\__gnuplot_ginput__.m at line 152, column 5
>octave-3.2.3.exe:6:~\Desktop
>> debug_on_warning
>ans = 0
>octave-3.2.3.exe:7:~\Desktop
>> __gnuplot_ginput__(gcf,1)
>error: A(I) = X: X must have the same size as I
>error: called from:
>error: C:\Documents and Settings\Matthias
>Brennwald\Desktop\__gnuplot_ginput__.m at line 152, column 5
>octave-3.2.3.exe:7:~\Desktop
>-------------
>
>Does this help somehow?
>
>Matthias
hmmm ... I was hoping to get some insight, but I don't see how line 152 could
be the problem.
63 if (use_mkfifo)
64 gpin_name = tmpnam ();
65
66 ##Mode: 6*8*8 == 0600
67 [err, msg] = mkfifo (gpin_name, 6*8*8);
68
69 if (err != 0)
70 error ("ginput: Can not open fifo (%s)", msg);
71 endif
72 endif
<snip>
151 unwind_protect_cleanup
152 if (use_mkfifo)
153 unlink (gpin_name);
154 endif
155 end_unwind_protect
If line 152 produces an warning, why not line 63?
Perhaps the unwind_protect construct should be removed to allow us to debug
this?
Try the attached.
Ben
__gnuplot_ginput__.m
Description: Binary data
- Problem with ginput, Matthias Brennwald, 2009/12/09
- Re: Problem with ginput, Ben Abbott, 2009/12/09
- Re: Problem with ginput, Matthias Brennwald, 2009/12/09
- Re: Problem with ginput, Matthias Brennwald, 2009/12/10
- Re: Problem with ginput, Benjamin Lindner, 2009/12/10
- Re: Problem with ginput, Benjamin Lindner, 2009/12/10
- Re: Problem with ginput, Matthias Brennwald, 2009/12/10