cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
perrydl
Level I

Line graph Y axis is wrong

I'm trying to create a simple line graph and the y-axis is wrong. I've tried manually changing the y axis to span from -5 to 45 but it compresses the data within the lower portion of the screen. Please help. 

 

 

Study DaySNR Right 1401 SNR Right 1977 SNR Right 2834 SNR Right 4002 SNR Right 5636 SNR Right 7988 SNR Right 11288 SNR Right 12721 SNR Right 14589 SNR Right 16769 SNR Right 19260 
-423162014311122194199
312615151133027151038
4123161923341028203513
551921141527202526-21718
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Line graph Y axis is wrong

Using your provided data table, and 

     Graph=>Parallel Plot

I get the following graph, which allows for the changing of the Y axis.  Also, I have specified to Scale Uniformly

txnelson_0-1662572345111.png

Here is the script

Parallel Plot(
	Scale Uniformly( 1 ),
	Center at zero( 0 ),
	Y(
		:SNR Right 1401, :SNR Right 1977, :SNR Right 2834, :SNR Right 4002,
		:SNR Right 5636, :SNR Right 7988, :SNR Right 11288, :SNR Right 12721,
		:SNR Right 14589, :SNR Right 16769, :SNR Right 19260
	),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Min( 0 ), Max( 11 ), Inc( 0.5 ), Minor Ticks( 0 )}
		),
		Dispatch(
			{},
			"2",
			ScaleBox,
			{Min( -6.01186672653397 ), Max( 40.6968191294088 ), Inc( 5 ),
			Minor Ticks( 1 )}
		),
		Dispatch(
			{},
			"Parallel Coord",
			FrameBox,
			{Frame Size( 1525, 470 ), Marker Size( 4 ),
			Marker Drawing Mode( "Normal" ),
			DispatchSeg( PolylineSeg( 1 ), {Line Width( 3 )} )}
		)
	)
)

.   

Jim

View solution in original post

7 REPLIES 7
txnelson
Super User

Re: Line graph Y axis is wrong

Is this the graph????  

txnelson_0-1662524309489.png

 

Jim
pmroz
Super User

Re: Line graph Y axis is wrong

Can you post a picture of how the graph is incorrect?  If you double-click on the Y axis you can set the min, max and increment.

pmroz_1-1662546212363.png

 

I was able to reproduce Jim's version of the graph very easily.

pmroz_0-1662546169189.png

 

Here's the JSL code:

Graph Builder(
	Size( 525, 454 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Study Day ),
		Y( :SNR Right 1401 ),
		Y( :SNR Right 1977, Position( 1 ) ),
		Y( :SNR Right 2834, Position( 1 ) ),
		Y( :SNR Right 4002, Position( 1 ) ),
		Y( :SNR Right 5636, Position( 1 ) ),
		Y( :SNR Right 7988, Position( 1 ) ),
		Y( :SNR Right 11288, Position( 1 ) ),
		Y( :SNR Right 12721, Position( 1 ) ),
		Y( :SNR Right 14589, Position( 1 ) ),
		Y( :SNR Right 16769, Position( 1 ) ),
		Y( :SNR Right 19260, Position( 1 ) )
	),
	Elements(
		Points(
			X,
			Y( 1 ),
			Y( 2 ),
			Y( 3 ),
			Y( 4 ),
			Y( 5 ),
			Y( 6 ),
			Y( 7 ),
			Y( 8 ),
			Y( 9 ),
			Y( 10 ),
			Y( 11 ),
			Legend( 5 )
		),
		Line(
			X,
			Y( 1 ),
			Y( 2 ),
			Y( 3 ),
			Y( 4 ),
			Y( 5 ),
			Y( 6 ),
			Y( 7 ),
			Y( 8 ),
			Y( 9 ),
			Y( 10 ),
			Y( 11 ),
			Legend( 7 )
		)
	),
	SendToReport(
		Dispatch( {}, "Study Day", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch(
			{},
			"SNR Right 1401",
			ScaleBox,
			{Min( -5 ), Max( 45 ), Inc( 5 ), Minor Ticks( 1 ),
			Label Row( Show Major Grid( 1 ) )}
		),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				5,
				Base( 0, 0, 0, Item ID( "SNR Right 1401", 1 ) ),
				Base( 1, 0, 0, Item ID( "SNR Right 1977", 1 ) ),
				Base( 2, 0, 0, Item ID( "SNR Right 2834", 1 ) ),
				Base( 3, 0, 0, Item ID( "SNR Right 4002", 1 ) ),
				Base( 4, 0, 0, Item ID( "SNR Right 5636", 1 ) ),
				Base( 5, 0, 0, Item ID( "SNR Right 7988", 1 ) ),
				Base( 6, 0, 0, Item ID( "SNR Right 11288", 1 ) ),
				Base( 7, 0, 0, Item ID( "SNR Right 12721", 1 ) ),
				Base( 8, 0, 0, Item ID( "SNR Right 14589", 1 ) ),
				Base( 9, 0, 0, Item ID( "SNR Right 16769", 1 ) ),
				Base( 10, 0, 0, Item ID( "SNR Right 19260", 1 ) )
			)}
		)
	)
)
perrydl
Level I

Re: Line graph Y axis is wrong

Screenshot 2022-09-07 123620.jpg

Screenshot 2022-09-07 123807.jpg

Thank you for trying to assist me. I'm graphing raw data. The top is what I'm seeing and the bottom is what I need (and what JMP is producing from the same data type). The SNR frequency data should be on the X-axis and timepoints across. The data is from a single individual. I tried to change the Y axis limits but it only compresses the data. 

txnelson
Super User

Re: Line graph Y axis is wrong

Using your provided data table, and 

     Graph=>Parallel Plot

I get the following graph, which allows for the changing of the Y axis.  Also, I have specified to Scale Uniformly

txnelson_0-1662572345111.png

Here is the script

Parallel Plot(
	Scale Uniformly( 1 ),
	Center at zero( 0 ),
	Y(
		:SNR Right 1401, :SNR Right 1977, :SNR Right 2834, :SNR Right 4002,
		:SNR Right 5636, :SNR Right 7988, :SNR Right 11288, :SNR Right 12721,
		:SNR Right 14589, :SNR Right 16769, :SNR Right 19260
	),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Min( 0 ), Max( 11 ), Inc( 0.5 ), Minor Ticks( 0 )}
		),
		Dispatch(
			{},
			"2",
			ScaleBox,
			{Min( -6.01186672653397 ), Max( 40.6968191294088 ), Inc( 5 ),
			Minor Ticks( 1 )}
		),
		Dispatch(
			{},
			"Parallel Coord",
			FrameBox,
			{Frame Size( 1525, 470 ), Marker Size( 4 ),
			Marker Drawing Mode( "Normal" ),
			DispatchSeg( PolylineSeg( 1 ), {Line Width( 3 )} )}
		)
	)
)

.   

Jim
perrydl
Level I

Re: Line graph Y axis is wrong

Hi Jim,

 

That is correct but I don't know how to replicate what you did to generate the plot. 

txnelson
Super User

Re: Line graph Y axis is wrong

I started with your data table

txnelson_0-1662576771339.png

I then when to 

     Graph=>Parallel Plot

txnelson_1-1662576897054.png

I selected all of the SNR columns as the Y, Response columns and then selected    Scale Uniformly

txnelson_2-1662577015830.png

Then the remainder is just changing the line color and thickness, and adjusting the X and Y axes

To change the line colors, click directly on one of the lines.  Then right click and select Row Colors and choose the color for the line.  Repeat for each line

To change the line width, right click on the graph and select Customize

Select Polyline, and change the line width

txnelson_3-1662577432140.png

Not all SNR values are being displayed.  To change the X axis, right click on the axes and select Axis Settings

Change the Tick/Bin Increment to .5

txnelson_4-1662577640539.png

Lastly, the Y axis settings can be changed using the same method as the X axis.  Right click on the axis, and select Axis Settings.

Change the Minimum and Maximum values to -5 and 40.

Change the Tick/Bin Increment to 5

txnelson_5-1662577830147.png

Which ends up giving the following graph

txnelson_6-1662577924941.png

 

 

 

 

 

 

 

 

 

 

 

Jim
perrydl
Level I

Re: Line graph Y axis is wrong

This was an amazing help!  I just completed the graphs!  Thank you so very much!  I cannot tell you how much I appreciate your help.