Description Usage Arguments Details Value Examples
Function to visualize a nanoparticle using rgl package.
1 2 |
nanop |
numeric matrix in which each row gives the coordinates of an atomic position in the nanoparticle. If nanop is not an object returned by |
radius |
numeric vector or single value. Each atom on a plot is represented by a sphere. |
legend |
logical indicating whether to print plot legend. |
col |
numeric vector defining colours to be used for plotted items. If vector |
box |
logical indicating whether to draw box and axes. |
play |
logical. If |
atoms |
character. If not |
miller |
numeric vector, specifies Miller indices. If not |
lattice |
numeric vector indicating particle core lattice parameters. Should be given in the same form as in |
If only core (shell) atoms of a specific type to be plotted atoms
should be set up to "core X"
or "shell X"
, respectively. Character describing atom type "X"
can be taken from attributes(part)$atomsCore or attributes(part)$atomsShell.
a vector of object IDs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | ## rgl library demands graphical terminal to be available
## uncoment all plotPart() calls for 3D visualization
## simulate particle
Au <- createAtom("Cu")
Au$name <- "Au"
Pd <- createAtom("Cu")
Pd$name <- "Pd"
part <- simPart(atoms=list(Au), atomsShell=list(Pd), rcore=8)
## 3d scatter plot
#plotPart(part, col=c(2,4))
## increase number of atom types within the particle:
Zn <- createAtom("Zn")
S <- createAtom("S")
part <- simPart(atoms=list(Zn ,S), atomsShell=list(Au), r=14,
rcore=12, sym="hcp", symShell="fcc", latticep=c(4.3, 7.04),
latticepShell=4.08)
## 3d scatter plot
#plotPart(part, col=c(2,4,3))
## play animation:
#plotPart(part, col=c(2,4,3), play=TRUE)
## plot only shell particles
#plotPart(part, col=c(2,4,3), atoms="shell Au", play=TRUE)
part <- simPart(atoms=list(Zn ,S),r=20, sym="hcp",
latticep=c(4.3, 7.04))
## display plane normal to z-axis:
#plotPart(part, miller=c(0, 0, 0 ,1), lattice=c(4.3, 7.04))
##S atoms:
#plotPart(part, miller=c(0, 0, 0 ,1), lattice=c(4.3, 7.04),
# atoms = "core S")
## save picture in a file using rgl function:
#rgl.snapshot( filename = "plane0001 S atoms.png")
Na <- createAtom("Na")
Cl <- createAtom("Cl")
part <- simPart(atoms=list(Na,Cl), sym="fcc")
#plotPart(part, miller=c(1,0,1), box=TRUE, lattice=c(4.08))
## plot only Na atoms:
#plotPart(part, miller=c(1,0,1), box=TRUE, lattice=c(4.08),
# atoms = "core Na")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.