cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
lala
Level IX

Is it possible to achieve this type of plotting using JSL?

Plotting in a specified column: Plotting data from multiple columns in the same row as a graphic within this column.

It seems the effect of the new column manager is not like this.

Thanks!2025-02-25_18-33-07.png

17 REPLIES 17
jthi
Super User

Re: Is it possible to achieve this type of plotting using JSL?

That data you have in excel doesn't look same as you did provide us with so it is impossible to know what you wish to have

jthi_0-1740493811369.png

 

-Jarmo
lala
Level IX

Re: Is it possible to achieve this type of plotting using JSL?

Do not have all columns of data mapping, only 188-202 columns of data mapping

 

Thank jthi !

dt = Current Data Table();
q=188;p=202;na="Row 3 Columns "||char(q)||"-"||char(p)||" Bar Chart";
row_data = dt[3, 188::202];
n_points = N Col(row_data);
x_values = Index(1, n_points);
y_max_data = Max(row_data);
y_max_scale = y_max_data * 1.1; 
if(y_max_scale == 0, y_max_scale = 10); 
New Window(na ,
	g = Graph Box(
		Frame Size( 400, 200 ),
		X Scale( 0.5, 12.5 ),   
		Y Scale( 0, y_max_scale ),     
		Pen Size( 1 ),         
		Fill Color( "Light Purple" ), 
		For( i = 1, i <= n_points, i++,
			Rect(             
				x_values[i] - 0.4, row_data[i], 
				x_values[i] + 0.4, 0           
			)
		)
	)
);
frame = g[FrameBox(1)];
frame << Grid Line Order( 1 );
frame << Add Graphics Script(
	Text( Center Justified, {6, y_max_scale * 0.95}, na )
);
  • Mine is ugly

jthi
Super User

Re: Is it possible to achieve this type of plotting using JSL?

And I assume you now have your solution?

-Jarmo
lala
Level IX

Re: Is it possible to achieve this type of plotting using JSL?

  • I need your help with answers.

Thank jthi !

  • I want to learn how to do that with a formula.

2025-02-26_07-36-39.png

 

 

jthi
Super User

Re: Is it possible to achieve this type of plotting using JSL?

I don't suggest doing this type of things in formulas as they don't get properly re-evaluated. Formula:

start_idx = 188;
end_idx = 202;

ncol = end_idx - start_idx + 1;
vals = Current Data Table()[Row(), start_idx::end_idx]`;
vals[Loc(vals, .)] = 0;

g = Graph Box(
	Frame Size(300, 120),
	X Scale(-0.5, ncol + 0.5),
	Y Scale(0, Max(vals) + Max(vals) * 0.05),
	Fill Color("Dark Blue"),
	For(i = 1, i <= ncol, i++,
		Rect(i - 1, vals[i], i, 0, 1)
	);
);
g[FrameBox(1)] << get picture;

I would rather have a table script which would then re-create the images when that table script is run

-Jarmo
lala
Level IX

Re: Is it possible to achieve this type of plotting using JSL?

Thank jthi !

  • I just need a quick map. That should do it

2025-02-26_16-37-12.png

lala
Level IX

Re: Is it possible to achieve this type of plotting using JSL?

This form of mapping allows you to make a vertical inversion of the graph (not a simple rotation of 180 degrees).

Of course, it can be done in other ways.I've tried taking negative values and using histograms to do the same thing.But it would be faster if we could just erect it.

 

Thanks Experts!

2025-02-26_16-37-12.png

lala
Level IX

Re: Is it possible to achieve this type of plotting using JSL?

OK

 Rect(i - 1, max_val, i, max_val - vals[i], 1)

Recommended Articles