BookmarkSubscribe
Choose Language Hide Translation Bar

Re: Ways to draw a heart in JMP?

DOE > Special Purpose > Space Filling Design will do it, too, with a Disallowed Combinations Script.

FFFheart.jpgScreen Shot 2017-02-14 at 2.49.56 PM.png

Check out the JMP blog: jmp.com/blog
Highlighted

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.Screen Shot 2017-02-14 at 3.15.15 PM.png

 

 

 

 

Check out the JMP blog: jmp.com/blog

Re: Ways to draw a heart in JMP?

Love this one!
Read the JMP Blog: jmp.com/blog
0 Kudos

Re: Ways to draw a heart in JMP?

Love this one!

Read the JMP Blog: jmp.com/blog
0 Kudos
Craige_Hales
Staff (Retired)

Re: Ways to draw a heart in JMP?

New Window( "heart",
	Text Box(
		"\!U2661",
		<<setfontname( "Arial Unicode MS" ),
		<<setFontScale( 20 ),
		<<fontcolor( "red" )
	)
);

Heart.PNGU2661 is a heart

 

SetFontScale is new for JMP 13.

Craige

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.

heart_in_browser.gif

Craige_Hales
Staff (Retired)

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 ) ), 
);

Heart3D.PNG3D heart

The surface plot takes the equation in X,Y,Z and shows the semi-transparent iso-surface.

Craige
ryandewitt
Community Manager Community Manager

Re: Ways to draw a heart in JMP?

These are all fantastic, really enjoyed them today. 

Ryan DeWitt
Community Manager | Learning Content Specialist | SAS JMP Customer Care
MathStatChem
Community Trekker

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();
				)
			)
		)
	);

Heart.png

 

Re: Ways to draw a heart in JMP?

Nice!
Read the JMP Blog: jmp.com/blog
0 Kudos