Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - Português

Change language to:
English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Ajuda do Scilab >> Biblioteca de Gráficos > xsegs

xsegs

desenha segmentos desconexos

Seqüência de Chamamento

xsegs(xv,yv,[style])

Parâmetros

xv,yv

matrizes de mesmo tamanho

style

vetor ou escalar. Se style is a positive scalar, it gives the color to use for all segments. Se style for negativo, então a cor corrente é utilizada. Se style for um vetor, então style(i) fornece a cor a ser utilizada no segmento i.

Descrição

xsegs desenha um conjunto de segmentos desconexos dados por xv e yv. Se xv e yv forem matrizes, serão considerados como vetores através da concatenação de suas colunas. As coordenadas dos dois pontos definindo um segmento são dadas por dois valores consecutivos de xv e yv:

(xv(i),yv(i))-->(xv(i+1),yv(i+1)).

Por exemplo, utilizando matrizes de tamanho (2,n), os segmentos são definidos por:

xv=[xi_1 xi_2 ...; xf_1 xf_2 ...]
yv=[yi_1 yi_2 ...; yf_1 yf_2 ...]

e os segmentos são (xi_k,yi_k)-->(xf_k,yf_k).

Exemplos

x=2*%pi*(0:9)/10;
xv=[sin(x);9*sin(x)];
yv=[cos(x);9*cos(x)];
plot2d([-10,10],[-10,10],[-1,-1],"022")
xsegs(xv,yv,1:10)
// 2D
plot2d([-10,10],[-10,10],[-1,-1],"022")
xsegs([9, -9],[9 , -9]) // Draw the line from X(9,9) to Y(-9, -9)
xsegs([5, -2],[4 , -1]) // Draw the line from X(5,4) to Y(-2, -1)
// 3D
clf();
a=gca();
a.view="3d";
f=gcf();
f.color_map=rainbowcolormap(120);
alpha=2*%pi*(0:119)/40;
xv=[sin(alpha)/2;sin(alpha)/3];
yv=[cos(alpha)/2;cos(alpha)/3];
zv=[alpha/8;alpha/8];
xsegs(xv,yv,zv,1:120);
a.data_bounds = [min(xv) min(yv) min(zv); ...
                 max(xv) max(yv) max(zv)];
e = gce();
e.arrow_size = 0.4;
Report an issue
<< xgraduate Biblioteca de Gráficos xset >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:09:46 CET 2017