[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ginput returns instantly
From: |
roumbaba |
Subject: |
ginput returns instantly |
Date: |
Thu, 31 Dec 2009 07:19:31 -0800 (PST) |
Hi all,
I am trying to use ginput but can't seem to get it to work really. Here is
what I do:
If i type:
octave> plot(1:10); [x,y] = ginput(1)
then I instantly get
x = 0
y = 0
ginput does *NOT* wait for me to actually click on the plot.
I am probably missing something obvious but can't find what.
I tried both octave versions 3.0.5 and 3.2.3 (with the patches below).
I am running octave in os x 10.5.8 with gnuplot 4.2 patch level 3
Thanks,
Baba.
--------------
note: here are the two patches I applied to to octave 3.2.3:
http://hg.savannah.gnu.org/hgweb/octave/rev/fea3d4868692
*********
AND
*********
# HG changeset patch
# User Ben Abbott <address@hidden>
# Date 1258985714 18000
# Node ID 62557ef4696651a0768714715bcdd13118a92ea5
# Parent 131d8c70920afc5decb681f4358b633721acaba6
__gnuplot_ginput__.m: gnuplot requires "set multiplot" detect mouse input.
diff -r 131d8c70920a -r 62557ef46966 scripts/ChangeLog
--- a/scripts/ChangeLog Sun Nov 22 16:47:39 2009 -0500
+++ b/scripts/ChangeLog Mon Nov 23 09:15:14 2009 -0500
@@ -1,3 +1,8 @@
+2009-11-23 Alexander Sorokin <address@hidden>
+
+ * plot/__gnuplot_ginput__.m: gnuplot requires "set multiplot" detect
+ mouse input.
+
2009-11-22 Michael Goffioul <address@hidden>
* plot/print.m: Properly set the default ghostscript_binary
diff -r 131d8c70920a -r 62557ef46966 scripts/plot/__gnuplot_ginput__.m
--- a/scripts/plot/__gnuplot_ginput__.m Sun Nov 22 16:47:39 2009 -0500
+++ b/scripts/plot/__gnuplot_ginput__.m Mon Nov 23 09:15:14 2009 -0500
@@ -87,6 +87,8 @@
if (err != 0)
error ("ginput: Can not open fifo (%s)", msg);
endif
+ fputs (ostream, "unset multiplot;\n\n");
+ fputs (ostream, "set mouse;\n\n");
fputs (ostream, "pause mouse any;\n\n");
fputs (ostream, "\nif (exists(\"MOUSE_KEY\") && exists(\"MOUSE_X\"))
print MOUSE_X, MOUSE_Y, MOUSE_KEY; else print \"0 0 -1\"\n");
@@ -100,6 +102,8 @@
else
fprintf (ostream, "set print \"-\";\n");
fflush (ostream);
+ fputs (ostream, "unset multiplot;\n\n");
+ fputs (ostream, "set mouse;\n\n");
fputs (ostream, "pause mouse any;\n\n");
fputs (ostream, "\nif (exists(\"MOUSE_KEY\") && exists(\"MOUSE_X\"))
print \"OCTAVE: \", MOUSE_X, MOUSE_Y, MOUSE_KEY; else print \"0 0 $
--
View this message in context:
http://old.nabble.com/ginput-returns-instantly-tp26979237p26979237.html
Sent from the Octave - General mailing list archive at Nabble.com.
- ginput returns instantly,
roumbaba <=