octave-maintainers
[Top][All Lists]
Advanced

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

Another thread on Oplot...and handle graphics.


From: Ole Jacob Hagen
Subject: Another thread on Oplot...and handle graphics.
Date: Tue, 19 Jul 2005 10:15:30 +0000
User-agent: Mozilla Thunderbird 1.0 (X11/20050307)

Hi, Octaver's.

I've created a milestone1.m for Oplot, to show how far(/short) I have reached in Oplot-development.

Besides octplot there are no visualisation applications that can run this script.

Please check out the script, by using Matlab or Oplot to see the results.

Which plotting routines are most commonly used by you? Please let me know, maybe I will give it higher priority.
Or maybe you can send me the m-script, if its possible.

Refinement of appearance, and adding new object such as Patch, Surface is being developed as fast as possible. However, skeleton-implementation for Surface has already been implemented.

Cheers,

Ole J.
%% Test file for Props and Oplot


%%%%%%%%% first we define some data to play with %%%%%

t = 0:0.2:30;
y1 = 3*sin(6*t);
y2 = cos(12*t) + 2;

X1 = y1'*y2;

fidx =1;
axax(1,:) = [-1 35 -4 6];
axax(2,:) = [0 1 0 1];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% simple plot command  %%%%%%%
figure(fidx)
clf
plot(t,y1)
xlabel('Here is an x label');
ylabel('Here is an y label');
axis(axax(1,:))
title('Yo, this is nice plot!')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% simple plot command with different
% markers
figure(fidx)
clf
plot(t,y1,'ok')
hold on
plot(t,y1,'+r')
plot(t,y1+2,'*g')
xlabel('Here is an x label');
ylabel('Here is an y label');
axis(axax(1,:))
title('Yo, this is ANOTHER nice plot!')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% simple plot command with different
% markers of different size
figure(fidx)
clf
h1 = plot(t,y1,'ok')
hold on
h2 = plot(t,y1,'+r')
h3 = plot(t,y1+2,'*g')

set(h1,'markersize',10)
set(h2,'markersize',20)
set(h3,'markersize',30)

xlabel('Here is an x label');
ylabel('Here is an y label');
axis(axax(1,:))
title('Plot with different marker sizes')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% simple plot command where we change the
% line size
figure(fidx)
clf
h1 = plot(t,y1)
set(h1,'linewidth',4);
xlabel('Here is an x label');
ylabel('Here is an y label');
axis(axax(1,:))
title('Changing line width')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plot command where we change the
% line size, insert text, draw a line
figure(fidx)
disp('jeg er vel her, tror jeg');
printf('figure nummer = %f\n', fidx);
clf
U = rand(10,3);
[n,m]=size(U);
h1 = plot(U(:,1)',U(:,2)','.k')
hold on
set(h1,'markersize',10);
for i = 1:n
  str = ['Point no. ' int2str(i)];
  text(U(i,1),U(i,2),str);
end;
% adding a line

g0 = line([0 1],[0 1])
set(g0,'linewidth',4,'color',[1 0 1]);

g1=xlabel('Here is an x label');
g2=ylabel('Here is an y label');

set(g1,'fontsize',20);
set(g2,'fontsize',20);

axis(axax(2,:))
g3=title('Shouting is fun!')

set(g3,'fontsize',25,'color',[1 0 0],'fontname','courier','FontWeight','bold');
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Her er milestone filen for image plottingen:

% Here is some example use of image commands

[r,g,b] = imread('testimage.jpg');
X(:,:,1) = r;
X(:,:,2) = g;
X(:,:,3) = b;


fidx = fidx+1;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%  simple image plot  %%%%%%%
figure(fidx)
clf

image(X)
hold on

xx = round(300*rand(1,50));
yy = round(300*rand(1,50));
h = plot(xx,yy,'.k');
set(h,'markersize',45,'color',[0 0 1]);

xlabel('Here is an x label');
ylabel('Here is an y label');
title('Simple image plot')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%  image with suplot plot  %%%%%%%
hold off;
figure(fidx)
clf

subplot(2,2,1);
image(X)

title('No.1');

subplot(2,2,2);
image(X)
hold on
xx = round(300*rand(1,50));
yy = round(300*rand(1,50));
h = plot(xx,yy,'.k');
set(h,'markersize',25,'color',[1 1 1]);
title('No.2');

subplot(2,2,3);
image(X)
hold on
xx = round(300*rand(1,50));
yy = round(300*rand(1,50));
h = plot(xx,yy,'.k');
set(h,'markersize',25,'color',[1 0 1]);
title('No.3');

subplot(2,2,4);
image(X)
hold on
xx = round(300*rand(1,50));
yy = round(300*rand(1,50));
h = plot(xx,yy,'.k');
set(h,'markersize',25,'color',[0 0 0]);

title('No.4');
xlabel('Here is an x label');
ylabel('Here is an y label');
title('Image plot with more stuff','fontsize',14,'color','g')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

reply via email to

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