Comments (9)
I think detection of plot changes should be provided by octave itself. We need to discuss the details with the octave community.
from octave.
See this commit
from octave.
The digest is for detecting whether the ans is changed. Create PR and I will carefully review the changes.
from octave.
How about solving this issue by forcing the display when the last line of the the statements is a plot/imshow/... function call?
from octave.
Just re-impl the plot part. Have fun!
from octave.
Thanks @sadhen! I really like your solution of searching for plot functions.
It seems isplot
doesn't work for multiline input. I'll add some tests to plots.tm
.
from octave.
For multiline input, currently, it is eval
ed at once. I know the flaws. But I don't want to do more string manipulation on octave code. There seems no official support of meta programming in octave.
from octave.
I think it should be possible to detect plot changes based on serialize
, but we would need to traverse the figure tree instead of serializing the top figure node.
I have been experimenting a bit and I think something like this could work:
function rets = traverse(node,s)
rets = s;
if ~isempty(node)
for i = 1:length(node.children)
rets = traverse(get(node.children(i)),rets);
endfor
rets = strcat(rets,"\n");
endif
rets = strcat(rets,serialize(node),"\t");
endfunction
Then we can do traverse(get(get(groot, "currentfigure")),"")
to get a string for the entire tree.
However, the tree contains function handles, which serialize.m
cannot handle, so there should be some more changes made there. Perhaps the func2str
function can be useful.
from octave.
It seems this might work to detect any changed figures:
function h = fighash(id)
fig_struct = hdl2struct (id);
save_header_format_string("","local")
h = hash("md5",save("-","-struct","fig_struct"));
endfunction
arrayfun("fighash",get(0,"children"), "UniformOutput", false)
from octave.
Related Issues (18)
- Support command `news` HOT 1
- Auto detect Octave.app HOT 1
- failed to display `eye(3)` HOT 1
- Multi-input: the last line did not show
- Support command `format` HOT 1
- Support command `clear` HOT 1
- Default pwd is `/`
- Support command `whos` HOT 1
- Support ls for Octave 6.x on Windows HOT 1
- Multi-line sessions and in-line graphics running Octave 6.1/6.2
- Support command `help`
- syntax error of for loop
- An unexpected flash when the session is started HOT 3
- Insert Octave Session gives me "busy... Message" HOT 1
- Octave session error due to "octave-cli" not recognizing "qt" as a plot toolkit on Linux HOT 5
- Support command `ls`
- Support PS1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octave.