https://wiki.octave.org/wiki/index.php?title=Interactive_plots&feed=atom&action=history
Interactive plots - Revision history
2024-03-29T15:41:28Z
Revision history for this page on the wiki
MediaWiki 1.39.2
https://wiki.octave.org/wiki/index.php?title=Interactive_plots&diff=13253&oldid=prev
Siko1056: /* Demo 1 */ Use syntax highlighter.
2020-07-13T06:09:46Z
<p><span dir="auto"><span class="autocomment">Demo 1: </span> Use syntax highlighter.</span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 06:09, 13 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l7">Line 7:</td>
<td colspan="2" class="diff-lineno">Line 7:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[File:interactive_select2.gif]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[File:interactive_select2.gif]]</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{Code|imageViewer example|<<del style="font-weight: bold; text-decoration: none;">pre</del>></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Code|imageViewer example|<<ins style="font-weight: bold; text-decoration: none;">syntaxhighlight lang="octave"</ins>></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>clear all</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>clear all</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>graphics_toolkit qt</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>graphics_toolkit qt</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l85">Line 85:</td>
<td colspan="2" class="diff-lineno">Line 85:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># first update</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># first update</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>drag_fig (gcf, [])</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>drag_fig (gcf, [])</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div></<del style="font-weight: bold; text-decoration: none;">pre</del>>}}</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></<ins style="font-weight: bold; text-decoration: none;">syntaxhighlight</ins>>}}</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Examples]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Examples]]</div></td></tr>
</table>
Siko1056
https://wiki.octave.org/wiki/index.php?title=Interactive_plots&diff=12244&oldid=prev
Siko1056: Add Category:Examples.
2019-08-21T02:06:39Z
<p>Add <a href="/Category:Examples" title="Category:Examples">Category:Examples</a>.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 02:06, 21 August 2019</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l86">Line 86:</td>
<td colspan="2" class="diff-lineno">Line 86:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>drag_fig (gcf, [])</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>drag_fig (gcf, [])</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre>}}</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre>}}</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Examples]]</ins></div></td></tr>
</table>
Siko1056
https://wiki.octave.org/wiki/index.php?title=Interactive_plots&diff=10631&oldid=prev
Andy1978: Created page with "This page shows some possibilities to create interactive OpenGL plots (qt or fltk toolkit) not using uicontrols. See also uicontrols where you can create buttons and slid..."
2018-01-20T11:31:51Z
<p>Created page with "This page shows some possibilities to create interactive OpenGL plots (qt or fltk toolkit) not using uicontrols. See also <a href="/Uicontrols" title="Uicontrols">uicontrols</a> where you can create buttons and slid..."</p>
<p><b>New page</b></p><div>This page shows some possibilities to create interactive OpenGL plots (qt or fltk toolkit) not using uicontrols.<br />
<br />
See also [[uicontrols]] where you can create buttons and slider to create plots<br />
<br />
== Demo 1 ==<br />
<br />
[[File:interactive_select2.gif]]<br />
<br />
{{Code|imageViewer example|<pre><br />
clear all<br />
graphics_toolkit qt<br />
set (0, "defaultlinelinewidth", 2);<br />
<br />
h.points = rand (2, 3); # 3 random points<br />
h.line = [];<br />
h.marker = [];<br />
set (gcf, "userdata", h)<br />
<br />
function down_fig (hsrc, evt)<br />
<br />
h = get (hsrc, "userdata");<br />
if (isempty (h.marker))<br />
hold on<br />
h.marker = plot (NA, NA, "o", "markersize", 15, "color", "green");<br />
hold off<br />
endif<br />
<br />
set (hsrc, "userdata", h);<br />
drag_fig (hsrc, evt);<br />
endfunction<br />
<br />
function drag_fig (hsrc, evt)<br />
<br />
# evt 1:left button, 2:middle button, 3:right button<br />
h = get (hsrc, "userdata");<br />
<br />
if (! isempty (h.marker))<br />
c = get (gca, "currentpoint")([1;3]);<br />
set (h.marker, "xdata", c(1));<br />
set (h.marker, "ydata", c(2));<br />
<br />
# find nearest point<br />
d = h.points - c;<br />
[~, idx] = min (hypot (d(1, :), d(2, :)));<br />
h.points(:, idx) = c;<br />
<br />
endif<br />
<br />
# draw / update the line<br />
tmp = [h.points h.points(:,1)]; # duplicate first point to close triangle<br />
if (isempty (h.line))<br />
h.line = plot (tmp(1, :), tmp(2, :), "-o");<br />
h.text = text (NA, NA, "", "horizontalalignment", "center");<br />
## testing<br />
axis ([0 1 0 1])<br />
else<br />
set (h.line, "xdata", tmp(1, :));<br />
set (h.line, "ydata", tmp(2, :));<br />
endif<br />
<br />
# calculate the area<br />
A = polyarea (h.points(1, :),<br />
h.points(2, :));<br />
P = mean (h.points, 2);<br />
set (h.text, "position", mean (h.points, 2).');<br />
set (h.text, "string", sprintf ("A = %.3f", A));<br />
<br />
set (hsrc, "userdata", h);<br />
<br />
endfunction<br />
<br />
function up_fig (hsrc, evt)<br />
<br />
h = get (gcbf, "userdata");<br />
delete (h.marker);<br />
h.marker = [];<br />
set (gcbf, "userdata", h);<br />
<br />
endfunction<br />
<br />
set (gcf, "windowbuttondownfcn", @down_fig);<br />
set (gcf, "windowbuttonmotionfcn", @drag_fig)<br />
set (gcf, "windowbuttonupfcn", @up_fig)<br />
<br />
# first update<br />
drag_fig (gcf, [])<br />
</pre>}}</div>
Andy1978