CPlot:SetInfo
The SetInfo method attaches ("tags") a string of data to a plotted point. To view these strings inside the Mira plot window, use the View > Query Point Data menu command to enable query mode and hover over the points.
success = CPlot:SetInfo( nIndex, strInfo ) |
nIndex is the index of the plot series, from 1 to CPlot:Count.
strInfo is a string containing the point data.
success is a boolean value indicating success.
On failure false is returned.
The following script pulls data from a photometry measurements table and stores the data in rows of a table named GridData. Each row of GridData contains the object name (sObj), airmass (nX), magnitude (nM), magnitude error (nE), and filter name (sF). Then a scatter plot is created from values in GridData. Afterward, the SetInfo method is used to attach a string of selected row data to each of the plotted points:
|
-- the master table of grid data |
|
-- get data from the grid, one row per grid row |
|
|
|
|
|
-- sFilter is the target filter for selecting from the photometry table |
|
|
|
|
|
-- now accumulate x, y, and ye (error bar) arrays for plotting |
|
|
|
-- table for x axis values |
|
|
-- table for y axis values |
|
|
-- table for y error bars |
|
-- each index for x, y, and ye is one row from GridData |
|
|
|
|
|
|
-- assign a variable to the table row |
|
|
-- copy the airmass into x[] |
|
|
-- copy the magnitude into y[] |
|
|
-- copy the magnitude error into ye[] |
|
|
|
|
|
|
|
-- Create a scatter plot of the photometry data |
|
|
-- The CPlotView V and current CPlot (plot series) P are returned |
|
|
-- For the y label, concatenate the target filter with " Mag" |
|
|
|
-- returns the CPlotView and CPlot |
|
|
|
|
|
-- check that the CPlotView is valid |
|
|
-- check that the CPlot is valid |
|
-- for the current plot series, tag each point with data |
|
|
|
-- for all plotted points... |
|
|
-- assign a variable to the table row |
|
|
-- create a string of point data |
|
|
|
|
|
-- assign the string to the point |
|
|
|
|
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.