GNU TeXmacs - Patches: patch #3133, Revisited octave plot interface
You are not allowed to post comments on this tracker with your current authentication level.
patch #3133: Revisited octave plot interface
Submitter: | None | ||
Submitted: | Tue 15 Jun 2004 08:22:02 AM UTC | ||
Category: | Plugins | Action: | Apply |
Privacy: | Public | Assigned to: | None |
Originator Email: | -email is unavailable- | Open/Closed: | Open |
Release: | 1.3.7 | Fixed Release: | |
Stable: |
Thu 10 Feb 2005 03:01:46 PM UTC, comment #3: |
Matteo Bertini <matteo99> |
Thu 17 Jun 2004 10:59:32 AM UTC, comment #2: Ops... my patch has problems with other kind of plots tha use directly _plt2??_.m
|
Matteo Bertini <matteo99> |
Tue 15 Jun 2004 08:29:08 AM UTC, comment #1: Following files can be removed, the are called inside _plt_ and so the output is correctly redirected to TeXmacs even using original octave sources.
|
Matteo Bertini <matteo99> |
Tue 15 Jun 2004 08:22:02 AM UTC, original submission:
I have seen that a multiple plot in octave like:
|
Anonymous |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2004-06-15 | None | Attached File | - | Added _tmplot_.m, #3365 | |
2004-06-15 | None | Attached File | - | Added _plt_.m, #3364 | |
2004-06-15 | None | Attached File | - | Added octave_plot.diffs, #3363 |
Powered by Savane 3.13-758e.
Corresponding source code
An update...
Hi all!
I've modified the octave plot plugin a little, now it works with all
commands because simply replot-to-TeXmacs at the end. I'm posting it
here because I'm not very confident with diff tools and patches... :-(
Usage:
octave] plot(...), hist(...), what-plot-command-you-like(...) <------ no
output
octave] tmreplot; <------ output the figure
You have to modify the tm-start.oct file to discard output by default:
#####################################
gset output "/dev/null"; #discard output by default
gset size 1,0.6; #I like it more then .5, .5
#####################################
This is the function, mainly taken from the present tm-octave plugin:
# cat /usr/share/TeXmacs/plugins/octave/octave/plot/tmreplot.m
#####################################
#Octave plots inside TeXmacs
#Created 3 Feb 2005
#Author Matteo Bertini <matteob@naufraghi.net>
#derived from Michael Graffam <mgraffam@mathlab.sunysb.edu> work
function tmreplot ()
if (length(getenv("TEXMACS_PATH"))>0)
# we are inside TeXmacs
gset output "/tmp/tmplot.eps";
replot;
P=[2;112;115;58]; # P= "\002ps:"
g=fopen("/tmp/tmplot.eps", "rb");
while (g==-1)
sleep(1);
g=fopen("/tmp/tmplot.eps", "rb");
endwhile
while (!feof(g))
f=fread(g,2048);
if (length(f))
P=[P;f];
endif
endwhile
fclose(g);
P=[P;5];
disp(sprintf("%cverbatim:",2));
disp(setstr(P'));
system("rm -f /tmp/tmplot.eps");
gset output "/dev/null";
else
usage("Use from TeXmacs");
endif
endfunction
#####################################
----------------------------- option two --------------------------------
You can easily restore the automatic output of plot with:
# cat /usr/share/TeXmacs/plugins/octave/octave/plot/plot.m
#####################################
#Octave plots inside TeXmacs
#Created 3 Feb 2005
#Author Matteo Bertini <matteob@naufraghi.net>
#derived from Michael Graffam <mgraffam@mathlab.sunysb.edu> work
function res = plot (varargin)
__plt__("plot", varargin{:});
if (nargout == 0)
tmreplot;
endif
res = 0;
endfunction
#####################################
This litle hack provides that:
octave] plot([1,2,3,4]); #has output
instead
octave] p = plot([1,2,3,4]); #is silent
octave] tmreplot; <------ output the figure
For other plotting functions the problem is that they don't have a
double wrapper like _plt_ so it is easy to get out of sync with the
official Octave sources (like it is now), so I think it is better the
tmreplot-at-the-end way.
----------- known problems --------------
TeXmacs.
then it is ok.
Expecting comments or suggestions,
Matteo Bertini