Ways to draw a heart in JMP?Here's one way to do it, using parametric equations found at Math World: Heart Curve.
New Table( "heart",
New Column( "t", Set Values( Index( 0, 2 * Pi(), 0.1 ) ) ),
New Column( "x", Formula( 16 * Power( Sin(t), 3 ) ) ),
New Column( "y", Formula( 13 * Cos(t) - 5 * Cos(2 * t) - 2 * Cos(3 * t) - Cos(4 * t) ) )
);
Graph Builder( Show Control Panel( 0 ), Variables( X( :x ), Y( :y ), Legend( 1 )), Elements( Formula( X, Y ) ),
SendToReport( Dispatch( {}, "400", ScaleBox,
{Legend Model( 1, Properties( 0, {Line Color( "Red" ), Line Width( 4 )} ) )})
)
);

Re: Ways to draw a heart in JMP?This is wonderful!
Re: Ways to draw a heart in JMP?The Boldt Castle is on Heart Island. http://www.boldtcastle.com/visitorinfo/
Re: Ways to draw a heart in JMP?Time has created many shapes on Earth's surface. Here's a hearty one. There must be more out there?
nw = New Window("Galešnjak Island", Graph Box());
nw[AxisBox(1)] << Scale("Geodesic") << Min(43.9761119) << Max(43.9806944);
nw[AxisBox(2)] << Scale("Geodesic") << Min(15.379375) << Max(15.387375);
nw[framebox(1)] << Background Map(Images("street map service"));

Re: Ways to draw a heart in JMP?Very cute! Thanks, Mandy!
Re: Ways to draw a heart in JMP?dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << colorByColumn(:sex);
dt<<NEW column=""></NEW><BR />

Hearts ...Hearts ...
Re: Ways to draw a heart in JMP?This is great -- thanks, John!
Re: Ways to draw a heart in JMP?This way of drawing a heart isn't new, but making it interactive with the help of JMP Public is new.
Press the play button and sliders at the bottom and use the menu beside 'Animated Heart' to change bubbleplot settings. See it on public.JMP.com.
Re: Ways to draw a heart in JMP?As Valentine's Day approaches I was reminded of this fun thread. I wonder if there are any new ways to do this in the last two years? Please share them here, and your JMP valentine could be featured on our social media channels -- thanks!
Re: Ways to draw a heart in JMP?Nice!Re: Ways to draw a heart in JMP?Here's a way to do it using drawing functions (no data table required):
Names Default To Here( 1 );
func_HeartFilledPolygon = Function(
{},
{_HeartShapeX, _HeartShapeY, t=0::2*Pi()::0.1},
_HeartShapeY = 13 * Cos( t ) - 5 * Cos( 2 * t ) - 2 * Cos( 3 * t ) - Cos( 4 * t ) ;
_HeartShapeX = Power( Sin( t ), 3 );
Eval( Substitute( Expr( Polygon( Expr( shape_x ), Expr( shape_y ) ) ), Expr( shape_x ), _HeartShapeX, Expr( shape_y ), _HeartShapeY ) );
);
new window("Belated Valentines Day",
_ob=OutlineBox("Heart",
_hlb=HListBox(
_grbox=Graph Box(
X Scale(-1.5, 1.5),
Y Scale(-20, 15),
XName(""),
YName(""),
Fill Color("red");
func_HeartFilledPolygon();
)
)
)
);

Re: Ways to draw a heart in JMP?These are all fantastic, really enjoyed them today.
Re: Ways to draw a heart in JMP?Here's a transparent heart, built on top of the 3D equation Dan found. Running the script is way more satisfying than the picture.
Surface Plot(
Show formula( 1 ),
Mode( "Isosurface" ),
Resolution( 101 ),
Surface Color( "Red" ),
Equation( "(x^2+9*y^2/4+z^2-1)^3-x^2*z^3-9*y^2*z^3/80" ),
SetVariableAxis( x, Axis Data( {Min( -1.3 ), Max( 1.3 ), Inc( 0.5 ), Minor Ticks( 1 )} ) ),
SetVariableAxis( y, Axis Data( {Min( -2 ), Max( 3 ), Inc( 1 ), Minor Ticks( 1 )} ) ),
SetVariableAxis( z, Axis Data( {Min( -1.3 ), Max( 1.3 ), Inc( 0.5 ), Minor Ticks( 1 )} ) ),
SetXVariable( x ),
SetYVariable( y ),
Frame3D( Set Graph Size( 700, 700 ), Set Spin( 0.004, 0, -0.5, -0.3 ), Set Rotation( -90, -10, 45 ) ),
);
3D heart3D heart
The surface plot takes the equation in X,Y,Z and shows the semi-transparent iso-surface.
Re: Ways to draw a heart in JMP?This animated gif shows a web application that generates 1000 random points every time the link is clicked. It then uses a JMP neural network model exported as JavaScript to score each location. The result - inside or outside the parametric "heart" curve - is used to assign color and size.

Re: Ways to draw a heart in JMP?Love this one!
Re: Ways to draw a heart in JMP?New Window( "heart",
Text Box(
"\!U2661",
<<SETFONTNAME></SETFONTNAME>
U2661 is a heartU2661 is a heart
SetFontScale is new for JMP 13.
Re: Ways to draw a heart in JMP?Love this one!Re: Ways to draw a heart in JMP?You can also get the 3D version of this by using the appropriate heart surface as the disallowed combination expression.
Re: Ways to draw a heart in JMP?DOE > Special Purpose > Space Filling Design will do it, too, with a Disallowed Combinations Script.


Re: Ways to draw a heart in JMP?If you create a column in a data table and change the data type to "expression", you can drag and drop heart images into rows. The iconarchive has many commerical free options to consider.

The column can be selected as a label and the images will show up in hover labels.

Re: Ways to draw a heart in JMP?For those who are loopy in love...
dt = New Table( "Loopy Heart",
New Column( "theta", Set Values( Index( 0, 360, .01 ) ) ),
New Column( "r", Formula( 3.5 - 1.5 * Abs( cos(:theta) ) * Sqrt( 1.3 + Abs( sin( :theta) ) ) + <BR /> cos( 2 * :theta ) - 3 * sin( :theta ) + 0.7 * cos( 12.2 * :theta ) ) ),
New Column( "x", Formula( :r * cos( :theta ) ) ),
New Column( "y", Formula( :r * sin( :theta ) ) ),
New Column( "color", "rowstate", Set Formula( Color State( {206, 0, 0} ) ) )
);
dt:color << Copy To Row States();
dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :x ), Y( :y ) ),
Elements( Points( X, Y, Legend( 9 ) ) ),
SendToReport( Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 0 )} ) )
);

Re: Ways to draw a heart in JMP?Fancy!Re: Ways to draw a heart in JMP?Since that animation worked, here's another one:

Re: Ways to draw a heart in JMP?Lovely!
Re: Ways to draw a heart in JMP?My little girl wanted animated, concentric hearts after she saw Xan's (thanks for the equations, Xan!)
names default to here(1);
t = Index( 0, 2 * Pi(), 0.03 );
x = Power( Sin( t ), 3 );
y = 13 * Cos( t ) - 5 * Cos( 2 * t ) - 2 * Cos( 3 * t ) - Cos( 4 * t );
factors = index(.1, 1, .1);
mx = x`*factors;
my = y`*factors;
nw = new window("Hearts",
gb = graphbox(
xscale(-1.5,1.5),
yscale(-20,15),
suppressaxes
)
);
fb = gb[framebox(1)];
for(i=1, i<=nrow(mx), i++,
eval(evalexpr(
fb << Add Graphics Script(
marker(colorstate("red"),mx[expr(i),0], my[expr(i),0])
);
));
wait(.001)
);
Here's a look about 75% of the way through:

Re: Ways to draw a heart in JMP?Super cool!Re: Ways to draw a heart in JMP?Scatterplot 3D(
Y( :t, :x, :y ),
Frame3D(
Set Wall Color( -16735350 ),
Set Grab Handles( 0 ),
Set Rotation( -86.2748434825603, -14.3412758272124, 89.6922810282153 ),
Background Color( 255, 152, 166 )
),
SendToReport( Dispatch( {}, "3", ScaleBox, {Min( -20.1415094339623 )} ) )
);

And for those with Ebulliophilia (Love of Bubbles)â¦
Bubble Plot(
X( :x ),
Y( :y ),
Time( :t ),
Speed( 164.16 ),
Bubble Size( 21 ),
Time Index( 62.38 ),
Show Roles( 0 ),
Draw( "Outlined" ),
Trail Bubbles( "All" ),
Trail Lines( "All" ),
Title Position( 1.14479166666667, -17.5 ),
SendToReport(
Dispatch( {}, "1", ScaleBox, {Min( -1.25 ), Max( 1.25 ), Inc( 0.5 ), Minor Ticks( 1 )} ),
Dispatch( {}, "2", ScaleBox, {Min( -17.5 ), Max( 12.5 ), Inc( 5 ), Minor Ticks( 1 )} ),
Dispatch( {}, "Bubble Plot", FrameBox, {Frame Size( 412, 313 )} )
)
);

Re: Ways to draw a heart in JMP?
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << colorByColumn(:sex);
dt << Bubble Plot(
X( :height ),
Y( :weight ),
Bubble Size( 30 ),
Set Custom Path(
"M-0.0887761244941046,0.850401752915005 C-0.132509691601686,0.801393885307063 -0.241710361277604,0.705852240487693 -0.331444173501431,0.638087060729371 C-0.59731840814714,0.437304249670604 -0.633503948597818,0.408246894851737 -0.741454403833403,0.308845722351141 C-0.940467837688774,0.125593337736938 -1.02498556965361,-0.0585152381026677 -1.02469594220815,-0.308151809968423 C-1.02455462493824,-0.430014445563118 -1.0162484277439,-0.476964317486802 -0.982121680497641,-0.548796088081649 C-0.924223053739587,-0.67066463840585 -0.838935502109301,-0.761222544208651 -0.729895396861719,-0.81660831893169 C-0.652666116521943,-0.855835967001217 -0.614576750684788,-0.873264164823037 -0.485609042303584,-0.873977173876701 C-0.350699586517109,-0.874722734579112 -0.322299550859126,-0.858992800688447 -0.242940961547844,-0.815395523171952 C-0.146347968002977,-0.762330214620364 -0.0469265717627411,-0.648920467226447 -0.0263747757632722,-0.568359238473025 L-0.0136814424115853,-0.518601854310303 L0.0176213189786486,-0.587129243639273 C0.194511321452139,-0.974373943618093 0.75925906037766,-0.96858025176609 0.955794219395568,-0.57750443258678 C1.01814070686722,-0.453444171783601 1.02498556965361,-0.188544549947051 0.969700405654138,-0.0393279571831673 C0.897583026328065,0.155319568139341 0.762129243985689,0.303715337410879 0.449006289596482,0.531116685379815 C0.243654945277814,0.680250541777138 0.0112441103286566,0.90589356734039 -0.00493465914355834,0.937585373794258 C-0.0237153698749651,0.974373943618093 -0.00583047238947826,0.943350568269966 -0.0887761244941046,0.850401752915005 z"
),
Set Shape( "Custom" ),
Title Position( 0, 0 ),
SendToReport(
Dispatch(
{},
"1",
ScaleBox,
{Min( 50 ), Max( 72.5 ), Inc( 5 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"2",
ScaleBox,
{Min( 60 ), Max( 180 ), Inc( 20 ), Minor Ticks( 0 )}
)
)
);