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


swap_handles

Permute two handles in the graphic Hierarchy.

Syntax

swap_handle( handle1, handle2 )

Arguments

handle1

first handle of the permutation.

handle2

second handle of the permutation.

Description

The swap_handles function allows to permute two handles in the graphic hierarchy. The first handle will take the second handle position and vice versa.

The handles must have the same parent type or the same type to avoid incompatibilities.

This routine may be used on children of the same parent to change their indices.

Examples

//-----------------//
//  First example  //
//-----------------//

// create a rectangle
xrect( 0.5, 0.5,0.5,0.5) ;
rect = gce() ;

// create a circle
xarc( 0.5, 0.5, 0.5, 0.5, 0, 64 * 360 ) ;
circle = gce() ;

// create an arrow
xpoly([0,1],[0,1]) ;
arrow = gce() ;
arrow.polyline_style = 4 ;
arrow.arrow_size_factor = 4 ;

// get the list of children
axes = gca()  ;
axes.children

// change the order
swap_handles( rect, arrow ) ;
swap_handles( arrow, circle ) ;

// get the new order
axes.children

//-----------------//
//  Second example //
//-----------------//

// create two windows
plot2d ;
axes1 = gca() ;

scf() ;
fec ;
axes2 = gca() ;

// swap their axes
// note that the color map does not change.
swap_handles( axes1, axes2 ) ;

See also

  • graphics_entities — description of the graphics entities data structures
  • copy — copy a graphics entity.
  • delete — delete a graphic entity and its children.
Report an issue
<< is_handle_valid handle unglue >>

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