Техплот

Robert08

нужен техплот,
есть у кого-нибудь?

Robert08

неужели ни у кого нет?

AlexV769

это?

% texplot.m
% Dan Warren
% 03.25.2003
%
% texplot(x,y,width,height,filename) creates a LaTeX picture file roughly equivalent
% to the matlab picture created by plot(x,y with dimensions width & height.
% The file will be called '<filename>.tex', and can be included. Please put
% the filename in single quotes so that Matlab doesn't think it's a variable (unless
% of course it is). x and y are expected to be matrices of the same size, and
% each row of x is plotted against the corresponding row of y.
%
% texplot(x,y,width,height,filename,legend) does the same thing, but creates and
% adds the legend (a 2d character array constructed by strvcat) to a default
% position in the top left of the plot. The legend is constructed and defined
% in a (created) file called <filename>_legend.tex. This file will not be created
% in the 5-argument version of the function above.
%
% texplot(x,y,width,height,filename,legend,lxpos,lypos) is as above, except that
% we specify the x and y positions of the legend in the last two arguments.
%
% SEE ALSO texlegend
function w = texplot(X,Y,width,height,filename,legend,lxpos,lypos);
if( nargin == 5)
legend = [];
lxpos = 0;
lypos = 0;
end
if( nargin == 6)
S = size(legend);
S = S(1);
lxpos = 60;
lypos = height - 10*S;
end
if( nargin > 5 )
texlegend(legend,filename);
end
S = size(X);
N = S(1);
% Set this path to be wherever your LaTeX source files are kept
path = 'C:\Progra~1\MiKTeX\miktex\bin\';
ext = '.tex';
% open up a file...
file = strcat(path,filename,ext);
fip=fopen(file,'wt');
color = strvcat('blue','red','green','yellow','cyan'); % new colors can be added to this list
minx = min(min(X;
miny = min(min(Y;
maxx = max(max(X;
maxy = max(max(Y;
xscale = abs(maxx - minx);
yscale = abs(maxy - miny);
width = width - 60;
height = height - 35;
fprintf(fip,'% Picture produced (MatLab) using texplot.m by Dan Warren\n');
if (nargin != 5)
fprintf(fip,strcat('\\input{',filename,'_legend.tex}\n';
end
fprintf(fip,'\\begin{picture}( %d , %d )\n',width+60,height+35);
fprintf(fip,'\\put(40,15){\\line(1,0){ %d }}\n\\put(40, %d ){\\line(1,0){ %d }}\n\\put(40,15){\\line(0,1){ %d }}\n\\put( %d ,15){\\line(0,1){ %d }}\n',width+20,height+35,width+20,height+20,width+60,height+20);
for I=1:N
x = X(I,:);
y = Y(I,:);

% This chooses the color. If you add more colors, replace the 5 with the
% (total) number of colors.
strcolor = strcat('\\color{',color(mod(I-1,5)+1,'}\n');
fprintf(fip,strcolor);

% scales the graph to the specified picture size
x = x - minx;
y = y - miny;
x = x/xscale*width + 50;
y = y/yscale*height + 25;

xlen = length(x);
ylen = length(y);
n = min(xlen,ylen);

% puts in extra points where they are too far apart to produce a pretty
% graph; this appears to be better than using the problematic line function, which
% has a limited number of slopes and can produce wierd output. Equivalent to producing
% a linear spline point by point. This is where the created file gets big.
i=1;
while( i < n )
di = (x(i+1) - x(i.^2 + (y(i+1) - y(i.^2;
if( di > 1.5 )
insertx = x(i) + x(i+1./2);
inserty = y(i) + y(i+1./2);
x = [x(1:i) insertx x(i+1:n)];
y = [y(1:i) inserty y(i+1:n)];
n = n+1;
else
i = i+1;
end
end

% make everything into integers so the LaTeX doesn't jam up...
x = round(x);
y = round(y);

for i=1:n
fprintf(fip,'\t \\put( %d , %d ){\\circle*{1}}\n',x(iy(i;
end
end
% Here, we should probably try to put some boxes or tics or scale numbers or something
x = X(1,:);
deltax = xscale/4;
deltay = yscale/4;
xlabelLocs = round([0 1/4 1/2 3/4 1]*width);
ylabelLocs = round([0 1/4 1/2 3/4 1]*height);
xlabelPts = [minx (minx+deltax) (minx+2*deltax) (minx + 3*deltax) maxx];
ylabelPts = [miny (miny+deltay) (miny+2*deltay) (miny + 3*deltay) maxy];
fprintf(fip,'\t\\color{black}\n');
for j=1:5
fprintf(fip,'\t \\put( %d , %d ){$ %6.2f $}',xlabelLocs(j)+45,0,xlabelPts(j;
fprintf(fip,'\t \\put( %d , %d ){\\line(0,1){5}}',xlabelLocs(j)+50,15);
fprintf(fip,'\t \\put( %d , %d ){$ %6.2f $}',0,ylabelLocs(j)+15,ylabelPts(j;
fprintf(fip,'\t \\put( %d , %d ){\\line(1,0){5}}',40,ylabelLocs(j)+25);
end
if( nargin != 5 )
fprintf(fip,'\t \\put( %d, %d ){ \\legend }\n',lxpos,lypos);
end
fprintf(fip,'\\end{picture}\n');
fclose('all');
w = ['file ' file ' constructed'];

Robert08


нет, не нужна програмка по-сложнее, наверное (может быть, конечно, я ее не узнала, но все же...)
достаточно удобная, отлично рисует графики разные, много всего умеет.
texplot(x,y,width,height,filename) creates a LaTeX picture file roughly equivalent% to the matlab picture created by plot(x,y).% The file will be called '<filename>.tex', and can be included.
- что-то похожее на правду, дальше не поняла
можно потом эти графики вставлять в тех, но лучше их сохранять как <filename>.ps

AlexV769

Origin 7.5 sr1
Да, и в след. раз, когда будешь искать какую-то прогу, пиши её название на языке-оригинале. Так не понятно, что искать - то ли texplot, то ли tehplot.

Robert08

techplot
так и называется

AlexV769

Вот видишь...
Как только название правильное дала - есть результат.
Держи ссылку. Доступно будет в течение дня.

Robert08

9 версии нет?
спасибо

AlexV769

я запостил то, что первой ссылкой выдал yahoo.com на запрос "techplot". Что такое 9я версия я не знаю - скачанный архив даже не смотрел. Мне хватает Origin.
Оставить комментарий
Имя или ник:
Комментарий: