copygo

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

copies graphics objects of a type list from an axis similar to findobj and copyobj

Description

copy and paste for graphics objects by introducing a figure CLIPBOARD

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

Example Illustration

 missing image of copygo(ca)

Syntax

h=copygo([ca])

Input Parameter

ca: axis to copy from

Output Parameter

h: handle to graphics objects

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)

This function, copygo, is designed to copy graphics objects of specified types from a given axis, similar to the functions findobj and copyobj. It introduces a figure clipboard for copying and pasting graphics objects.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize a list of default types of graphics objects to copy: line, patch, polygon, and text.
  2. Initialize an empty array h to store handles to the copied objects.
  3. Determine the axis ca to copy from. If ca is not a valid handle, use the current axis (gca).
  4. If additional arguments are provided, update the list of types to copy from the input arguments.
  5. For each type in the list, find all objects of that type in the specified axis and append their handles to h.
  6. If no output is requested, create a new figure to act as a clipboard, paste the copied objects into it, and then hide the clipboard figure.

Example Usage

The following example demonstrates how to use the copygo function:

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);

This example creates a figure with various graphics objects, copies lines and text objects, and then pastes them into another figure.

Algorithm explaination created using ChatGPT on 2025-08-19 07:21. (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