Syntax
h=copygo([ca])
Input Parameter
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
- ca: The axis from which to copy graphics objects. If not provided, the current axis (
gca
) is used.
Output Results
- h: A handle to the copied graphics objects.
Algorithm Steps
- Initialize a list of default types of graphics objects to copy:
line
, patch
, polygon
, and text
.
- Initialize an empty array
h
to store handles to the copied objects.
- Determine the axis
ca
to copy from. If ca
is not a valid handle, use the current axis (gca
).
- If additional arguments are provided, update the list of types to copy from the input arguments.
- For each type in the list, find all objects of that type in the specified axis and append their handles to
h
.
- 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