Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.0.0 - English


xchange

transform real to pixel coordinates

Syntax

[x1, y1, rect] = xchange(x, y, dir)

Arguments

x, y

two matrices of size (n1, n2) (coordinates of a set of points).

dir

a string, parameter used to specify the conversion type (See "Description" for details).

x1, y1

two matrices of size (n1, n2) (coordinates of the set of points).

rect

a vector of size 4.

Description

After having used a graphics function, xchange computes pixel coordinates from real coordinates and conversely, according to the value of the parameter dir: "f2i" (float to int) means real to pixel and "i2f" (int to float) means pixel to real.

x1 and y1 are the new coordinates of the set of points defined by the old coordinates x and y.

rect is the coordinates in pixel of the rectangle in which the plot was done: [upper-left point, width, height].

Examples

t=[0:0.1:2*%pi]';
plot2d(t,sin(t))
[x,y,rect]=xchange(1,1,"f2i")
[x,y,rect]=xchange(0,0,"i2f")
Report an issue
<< multiscaled plots Graphics Graphics export >>

Copyright (c) 2022-2024 (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 Oct 24 14:30:04 CEST 2023