swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mathematica to Java made easier


From: Marcus G. Daniels
Subject: Re: Mathematica to Java made easier
Date: 23 Apr 2000 20:50:37 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "B" == Benedikt Stefansson <address@hidden> writes:

B> By the way, If anyone could point out to me a visualization
B> solution that a) runs on Linux b) is able to do 3D surface plots
B> where you can control both the height of the surface and the color
B> at each point on the surface I'd be very interested in knowing
B> about it. 

Here's how I visualized a 4D space (a 3D normal distribution +
frequency) in OpenDX.

1. I generated 10,000 points in R using the `writesamples' function below.

1a. $ cat > gen.R << EOF
getsamples <- function (count, xstddev, ystddev, zstddev) {
  covarmatrix <- matrix(c(xstddev * xstddev,0,0,
                          0,ystddev * ystddev,0,
                          0,0,zstddev * zstddev),3,3)
  t(t(matrix(rnorm(count * 3),count,3) %*% 
    chol(covarmatrix)))
}

writesamples <- function () {
  vec <- getsamples (10000, 10, 10, 10)
  write (c("x","y","z","data"), file="input.txt", ncolumns=4)
  write (t(cbind(vec,1)), file="input.txt", ncolumns=4, append=TRUE)
}
EOF

1b. $ R
> source("gen.R")
> writesamples()
> quit()

2. I created OpenDX program using the visual programming environment.
(If you just want to see OpenDX demos, click on "Samples" when it comes up.
"Rubbersheet.net", "Histogram.net", and "Isosurface.net" are relevant
examples.)

2a. $ dx
2b.  "New Visual Program"
2c.  Under "Categories:" select "Import and Export", 
     Under "Import and Export Tools:" select "ImportSpreadsheet", and then
     clicked near the top middle of the "Untitled" workspace area
     to instantiate the ImportSpreadSheet tool.
2c1. Double clicked on the blue "ImportSpreadsheet" object in the workspace.
2c2. Entered the path of where R put the "input.txt" file.
2c3. "OK"
2d.  Under "Categories:" select "Structuring"
     Under "Structuring Tools:" select "Extract"
     Instantiate three "Extract" icons on the workspace in a row
2d1. Edit each by double clicking on it, changing "name", to "x", "y", and "z",
     respectively.
2d2. Drag from the left small box at the bottom of the "ImportSpreadSheet"
     icon to the top left box for each "Extract" instance.
2e.  Under "Categories:" select "Transformation"
     Under "Transformation Tools:" select "Compute"
2e1. Instantiate it under the "Extract" instances by clicking.
2e2. Under the "Edit" pull down select "Input/Output" tabs and then 
     "Add Input Tab"
2e3. Connect (by dragging) each box at the bottom of the "Extract" instances
     to each small box at the top of the new "Compute" box.
2e4. Double click on the "Compute box"
2e5. Enter "[a,b,c]" under "Expression" and press "OK"
2f.  Under "Transformation Tools:" select "Histogram"
2f1. Instantiate it under "Compute" by clicking
2f2. Connect the box under "Compute" to the left box on the top of "Histogram"
2f3. Double click on icon to bring up inspector
2f4. Enter "[20,20,20]" under "bins" / "Value"
2g.  Under "Transformation Tools:" select "AutoColor"
2g1. Instantiate it under "Histogram"
2g2. Connect the left box under "Histogram" to the top left box on "AutoColor"
2g3. Double click on it to bring up inspector
2g4. Under "min"/"Value" enter ".1"
2h.  Under "Categories:" select "Rendering"
     Under "Rendering Tools:" select "Image"
2h1. Instantiate it under "AutoColor"
2h2. Drag from the bottom left box on "AutoColor" to the top box on "Image"
2i.  Under the "Execute" pull-down, select "Execute once"
2j.  On the "Image" window, pull down the "Options" menu and select
     "View Control".
2k.  Under "Mode:" select "Rotate"

Holding the middle mouse button, you should now be able to drag the
mouse to get different angles for viewing this three dimensional,
colored normal distribution.

Btw, OpenDX has a Java interface.  I haven't tried it yet, though.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]