Two possible leads (without chasing the old threads):
(1) fvj4/dwin.ijs or chapter 10 in FVJ4
load '~addons/graphics/fvj4/dwin.ijs' There is a FVJ4 dwin lab and some
examples in remarks at the end of the script. Not 3D point sets, but
they might be added small polygons used instead. Some simple 3D
animations possible.
(2) simple MMA formatting. I have a basic set of formatting tools in a
script:
NB. mma_fmt.ijs
mma_fmt_seq=:}.@;@:(<@ (',',rplc&('_- ,')@":@:(**|))"0)
mma_fmt_list=:'{','}',~}.@;@:(<@ (',',rplc&('_- ,')@":@:(**|))"0)
mma_fmt_matrix=:'{','}',~}.@;@:(<@ (',',mma_fmt_list)"1)
mma_fmt_pllpd=: 'Parallelepiped[',mma_fmt_list@:[,',',mma_fmt_matrix@],']'"_
mma_fmt_pllpds=: [: _2&}.@:, [: ,&(',',LF)"1 mma_fmt_pllpd"1 2
mma_fmt_line=: ('Line[' , mma_fmt_matrix , ']'"_)"2
mma_fmt_lines=: [:}.@:, ',' ,. mma_fmt_line
mma_fmt_quads=: [: _2&}.@:, [: ,&(',',LF)"1 ('Polygon[', mma_fmt_matrix
,']'"_)"2
mma_hdr0=:'Graphics3D[{'
mma_hdr1=:'}]'
NB, end mma_fmt.ijs
After loadning that, you might try plotting three line segments:
]a=:_2]\0 0 0, 2 _3 1, _1 2 0, 1 1 1,_1 _2 3,: 3 4 2
0 0 0
2 _3 1
_1 2 0
1 1 1
_1 _2 3
3 4 2
mma_fmt_lines a
Line[{{0,0,0},{2,-3,1}}] ,Line[{{-1,2,0},{1,1,1}}]
,Line[{{-1,-2,3},{3,4,2}}]
]m=:mma_hdr0,mma_hdr1,~'Hue[0.5],',mma_fmt_lines a
Graphics3D[{Hue[0.5],Line[{{0,0,0},{2,-3,1}}] ,Line[{{-1,2,0},{1,1,1}}]
,Line[{{-1,-2,3},{3,4,2}}]}]
wd 'clipcopy *',m
The go to MMA and paste and execute
In practice you might add Point[] formatting and lots of commas,
brackets, linefeeds to actually handle the data with the colors and
sizes you want.
Best, Cliff
On 10/28/2017 8:31 AM, 'Skip Cave' via Programming wrote:
As part of my NLP project, I need a way to plot 2D & 3D point cluster plots.
Let's take the example in my previous email:
(0 0, 2 _3 ,: _1 2) dis 1 1,_1 _2,:3 4
1.41421 3.16228 4.47214
In that distance calculation, their are 6 coordinate pairs, representing 6
points in x & y.
The six points are:
0 0, 2 _3, _1 2, 1 1,_1 _2, 3 4
I want to see a plot of those 6 points.
1. How do I make a 2D plot that shows these 6 points as dots on an xy graph.
2. How can I make the first three points red dots, and the last three
points blue dots?
3. How can I change the soze (diameter} of the dots?
4. Now assume I have 6 more points, but they are in three dimensions:
0 0 0, 2 _3 1, _1 2 0, 1 1 1,_1 _2 3, 3 4 2
5. How do I make a 3D plot that shows these 6 points as small dots in a 3D
xyz perspective view graph
6. How do I rotate the view?
7. How can I make the first three points red dots, and the last three
points blue dots?
Skip
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm