Skip to content
Prev 378768 / 398502 Next

add points to lattice cloud plot (3D scatter)

On 2/28/19 7:56 AM, Jeff Newmiller wrote:
There is an panel.identify.cloud function which will let one interact 
with a plot as one can do with identify or panel.identify. It calls a 
function that you can view with:


getAnywhere(panel.3didentify)


That said, this is only discussing the possibility of adding to an 
existing 3d plot in theory. I've never done it. I have used some of the 
other "interaction" plotting functions to add lines and curves to 
existing plot objects. You can see the options that have been described in:

?panel.identify.cloud
 ??llines

I tried search for prior question on Rhelp but could only find examples 
where annotation of existing points was attempted, not any examples of 
adding points. I wondered if one could do it by simply editing the 
x,y,z? components of an existing lattice object:


 From object created from the iris dataset:

$ panel.args.common:List of 20
 ? ..$ x?????????? : num [1:150] 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
 ? ..$ y?????????? : num [1:150] 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
 ? ..$ z?????????? : num [1:150] 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...


I tried working with the original example in this thread but originally 
got an error that on traceback stated that there was a problem with 
arguments to latticeParseFormula. I didn't see why that would be, but 
taking out the `ltext` call allowed completion. I then only succeeded in 
modifying the plot when I prepended new data to the existing vectors, 
but not when I appended points. Perhaps there is a counter in the 
lattice object that I have not yet seen.


Hope this helps;

David.