help-octave
[Top][All Lists]
Advanced

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

A hack to get a data cursor in Octave 4.0.x and 4.2.x


From: roland65
Subject: A hack to get a data cursor in Octave 4.0.x and 4.2.x
Date: Wed, 1 Mar 2017 04:49:57 -0800 (PST)

Hi,

thanks to the work of Pantxo Diribarne (look  here
<http://octave.1599824.n4.nabble.com/Data-cursor-in-Octave-td4681801.html#a4681956>
 
), I was able to hack Octave to get a data cursor in 2D plots.

Here is how to do in Octave 4.0.x or 4.2.x:

In the attched zip file, you'll find three .m files. Copy these three files
to <prefix>/share/octave/<version>/m/plot/draw/private , where <prefix> is
/usr for Linux, c:\octave for Windows, etc. and <version> is Octave version
number.

2. Launch Octave gui and plot some curve, like this:

x=[0:0.01:2*pi]; y=sin(x); plot(x,y);

Then you'll see the sinus curve in a figure window. In the figure menu, at
the rightmost position, you'll see a new 'Data' menu item, where you can add
a new data cursor, show/hide data cursors or get cursor data. See the
attached screenshot as an example.

You can have several data cursors at the same time, with different colors,
fonts, etc. Just right click on a data cursor to change its properties.

This works with nearly all 2D plots (semilogx, semilogy, loglog, subplot)
but doesn't work with 3D plots (the Data menu is not displayed in this
case).

There are some minor issues, but it works quite well...

datacursor.zip
<http://octave.1599824.n4.nabble.com/file/n4682075/datacursor.zip>  
figure.png <http://octave.1599824.n4.nabble.com/file/n4682075/figure.png>  



--
View this message in context: 
http://octave.1599824.n4.nabble.com/A-hack-to-get-a-data-cursor-in-Octave-4-0-x-and-4-2-x-tp4682075.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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