pastego

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 4.5, Creation date: 2019-02-22, Last change: 2025-09-14

inserts graphics objects into the current axis gca

Description

copy and paste for graphics objects by introducing a figure CLIPBOARD

See Also: , copygo , copyfig , snapplot , copyplot , smbdrawnow , pushgcf , popgcf

Example Illustration

 missing image of pastego (h,hgca)

Syntax

pastego([h,hgca])

Input Parameter

h: object handles to insert
hgca: axis to insert and list of tyes

Examples


figure(111); cla; CPLplotasPS(PLcircle(10)); CPLplot(PLcircle(20),'b-'); textVL(PLcircle(15)); SGplot(SGbox(5));
h=copygo('line','text')
figure(111); h=copygo('line','text')
figure(123); cla; pastego(h);




Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

The function pastego is designed to insert graphics objects into the current axis (gca) in MATLAB. It is part of the SG-Library and was introduced in SolidGeometry 4.5. The function uses a figure clipboard to facilitate the copy and paste of graphics objects.

Input Parameters

Algorithm Steps

  1. Define a list of types typlist that includes 'line', 'patch', 'polygon', and 'text'. These are the types of graphics objects that can be handled by the function.
  2. Retrieve the first input parameter h using getfuncparams. If not provided, it defaults to an empty array.
  3. Retrieve the second input parameter hgca using getfuncparams. If not provided, it defaults to the current axis gca.
  4. Check if hgca is a valid handle using ishandle. If not, set hgca to gca and initialize si to 2. Otherwise, set si to 3.
  5. If h is empty, perform the following:
    • Store the current figure handle in sf.
    • Create a new figure clipb with a specific identifier (101010) and set its visibility to 'off'.
    • Use copygo to copy objects of types specified in typlist into h.
    • Return to the original figure sf.
  6. If the number of input arguments is greater than or equal to si, iterate over the additional arguments:
    • For each argument, find objects of the specified type in h using findobj.
    • Copy these objects to hgca using copyobj.
  7. If there are no additional arguments, copy all objects in h to hgca using copyobj.
Algorithm explaination created using ChatGPT on 2025-08-19 07:28. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21