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
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
- h: Object handles to insert. These are the graphics objects that you want to paste into the current axis.
- hgca: Axis to insert and list of types. This specifies the target axis where the objects will be inserted.
Algorithm Steps
- 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.
- Retrieve the first input parameter
h using getfuncparams. If not provided, it defaults to an empty array.
- Retrieve the second input parameter
hgca using getfuncparams. If not provided, it defaults to the current axis gca.
- 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.
- 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.
- 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.
- 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