cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-7302%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ECome%20aggiungere%20una%20linea%20di%2045%C2%B0%20(y%3Dx)%20al%20grafico%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7302%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20tahoma%2Carial%2Chelvetica%2Csans-serif%3B%20font-size%3A%2012pt%3B%22%3EQualcuno%20ha%20un%20modo%20pi%C3%B9%20intelligente%20per%20aggiungere%20una%20linea%20di%2045%20%C2%B0%20(y%20%3D%20x)%20a%20un%20grafico%20xy%3F%20Attualmente%20faccio%20quanto%20segue%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3COL%3E%3CLI%3E%3CSPAN%20style%3D%22font-family%3A%20tahoma%2Carial%2Chelvetica%2Csans-serif%3B%20font-size%3A%2012pt%3B%22%3EImpostare%20i%20pixel%20dell'asse%20x%20e%20dell'asse%20y%20sullo%20stesso%20valore%20nella%20finestra%20di%20dialogo%20Dimensione%20fotogramma%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20style%3D%22font-family%3A%20tahoma%2Carial%2Chelvetica%2Csans-serif%3B%20font-size%3A%2012pt%3B%22%3EUtilizzare%20lo%20strumento%20di%20disegno%20per%20aggiungere%20manualmente%20una%20linea%20al%20grafico%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20tahoma%2Carial%2Chelvetica%2Csans-serif%3B%20font-size%3A%2012pt%3B%22%3ELa%20linea%20non%20%C3%A8%20mai%20del%20tutto%20perfetta%20e%20deve%20essere%20aggiustata%20quando%20si%20cambia%20trama.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20tahoma%2Carial%2Chelvetica%2Csans-serif%3B%20font-size%3A%2012pt%3B%22%3ESviluppatori%20JMP%3A%20questa%20sarebbe%20un'ottima%20opzione%20da%20aggiungere%20a%3A%20specifica%20dell'asse%20Y%2C%20linee%20di%20riferimento.%20%C3%88%20utile%20quando%20si%20confrontano%20le%20previsioni%20rispetto%20a%20quelle%20effettive%3B%20determinazioni%20di%20laboratorio%20rispetto%20a%20valori%20standard%3B%20eccetera..%20Pensandoci%20meglio%2C%20avere%20l'opzione%20di%20inserire%20f(x)%20per%20una%20linea%20di%20riferimento%20y%20sarebbe%20anche%20meglio%20della%20semplice%20linea%20di%2045%C2%B0%20(y%3Dx).%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7307%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20aggiungere%20una%20linea%20di%2045%C2%B0%20(y%3Dx)%20al%20grafico%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7307%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEcco%20una%20versione%20della%20piattaforma%20con%20la%20linea%20tratteggiata%20e%20rossa%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20Open(%20%22%24sample_data%5CBoston%20Housing.jmp%22%20)%3B%0A%20%0Agb%20%3D%20Graph%20Builder(%0A%20%20%20%20%20%20%20Show%20Control%20Panel(%200%20)%2C%0A%20%20%20%20%20%20%20Variables(%20X(%20%3Arooms%20)%2C%20Y(%20%3Adistance%20)%20)%2C%20%20%0A%20%20%20%20%20%20%20Elements(%20Points(%20X%2C%20Y%2C%20Legend(%201%20)%20)%20)%2C%20%20%0A%20%20%20%20%20%20%20SendToReport(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20Dispatch(%20%7B%7D%2C%20%22rooms%22%2C%20ScaleBox%2C%20%7BMin(%200%20)%2C%20Max(%2012%20)%2C%20Inc(%202%20)%2C%20Minor%20Ticks(%201%20)%7D%20)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20Dispatch(%20%7B%7D%2C%20%22distance%22%2C%20ScaleBox%2C%20%7BMin(%200%20)%2C%20Max(%2012%20)%2C%20Inc(%202%20)%2C%20Minor%20Ticks(%201%20)%7D%20)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20Dispatch(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%7D%2C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Graph%20Builder%22%2C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20FrameBox%2C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7BMarker%20Size(%203%20)%2C%20Add%20Graphics%20Script(%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%202%2C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Description(%20%22Script%22%20)%2C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Pen%20Color(%20%22red%22%20)%3B%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Line%20Style(%20%22dashed%22%20)%3B%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Y%20Function(%20x%2C%20x%20)%3B%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%2C%20Grid%20Line%20Order(%201%20)%2C%20Reference%20Line%20Order(%203%20)%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20)%20%20%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22margin%3A%200px%200px%2010pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3EGli%20elementi%20grafici%20sono%20documentati%20nella%20Guida%20allo%20scripting%2C%20a%20partire%20da%20pagina%20497.La%20Guida%20allo%20scripting%20%C3%A8%20disponibile%20nella%20Guida%20di%20JMP%3D%3D%26gt%3BLibri%3D%3D%26gt%3BGuida%20allo%20scripting.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7306%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20aggiungere%20una%20linea%20di%2045%C2%B0%20(y%3Dx)%20al%20grafico%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7306%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIn%20che%20modo%20la%20linea%20di%20riferimento%20a%2045%20gradi%20pu%C3%B2%20essere%20riformattata%20come%20trattini%20e%20colori%20alternati%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7305%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20aggiungere%20una%20linea%20di%2045%C2%B0%20(y%3Dx)%20al%20grafico%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7305%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEcco%20un%20altro%20script%20che%20utilizza%20la%20piattaforma%20Bivariata%20(io%20uso%20JMP%2010.0.2)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20Open(%22%24SAMPLE_DATA%2FFitness.jmp%22)%3B%0A%20%0Adt%20%26lt%3B%26lt%3B%20Bivariate(%0A%20%20Y(%3AMaxPulse)%2C%0A%20%20X(%3ARunPulse)%2C%0A%20%20SendToReport(%0A%20%20Dispatch(%0A%20%20%7B%7D%2C%0A%20%20%22Bivar%20Plot%22%2C%0A%20%20FrameBox%2C%0A%20%20%7BAdd%20Graphics%20Script(2%2C%20Description(%22Script%22)%2C%20YFunction(x%2C%20x))%2C%0A%20%20Grid%20Line%20Order(1)%2C%20Reference%20Line%20Order(3)%7D%0A%20%20)%0A%20%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7304%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20aggiungere%20una%20linea%20di%2045%C2%B0%20(y%3Dx)%20al%20grafico%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7304%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EMolto%20bello.L'ho%20provato%20in%20Graph%20Builder%20e%20funziona%20a%20meraviglia.Ecco%20un%20esempio%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20open(%22%24sample_data%5CBoston%20Housing.jmp%22)%3B%0A%20%0Agb%20%3D%20Graph%20Builder(%0A%20%20%20%20Show%20Control%20Panel(%200%20)%2C%0A%20%20%20%20Variables(%20X(%20%3Arooms%20)%2C%20Y(%20%3Adistance%20)%20)%2C%0A%20%20%20%20Elements(%20Points(%20X%2C%20Y%2C%20Legend(%201%20)%20)%20)%2C%0A%20%20%20%20SendToReport(%0A%20%20%20%20%20%20%20%20Dispatch(%20%7B%7D%2C%20%22rooms%22%2C%20ScaleBox%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7BMin(%200%20)%2C%20Max(%2012%20)%2C%20Inc(%202%20)%2C%20Minor%20Ticks(%201%20)%7D%20)%2C%0A%20%20%20%20%20%20%20%20Dispatch(%20%7B%7D%2C%20%22distance%22%2C%20ScaleBox%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7BMin(%200%20)%2C%20Max(%2012%20)%2C%20Inc(%202%20)%2C%20Minor%20Ticks(%201%20)%7D%20)%2C%0A%20%20%20%20%20%20%20%20Dispatch(%20%7B%7D%2C%20%22Graph%20Builder%22%2C%20FrameBox%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7BMarker%20Size(%203%20)%2C%20Add%20Graphics%20Script(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%202%2C%20Description(%20%22Script%22%20)%2C%20Y%20Function(%20x%2C%20x%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20)%2C%20Grid%20Line%20Order(%201%20)%2C%20Reference%20Line%20Order(%203%20)%7D%20)%0A%20%20%20%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7303%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20aggiungere%20una%20linea%20di%2045%C2%B0%20(y%3Dx)%20al%20grafico%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7303%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ENel%3CEM%3E%20Adatta%20Y%20per%20X%3C%2FEM%3E%20piattaforma%20che%20puoi%20scegliere%3CEM%3E%20Vestibilit%C3%A0%20speciale...%3C%2FEM%3E%20e%20blocca%20l'intercetta%20a%20zero%20e%20la%20pendenza%20a%20uno.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENella%20maggior%20parte%20delle%20piattaforme%20%C3%A8%20anche%20possibile%20tracciare%20una%20linea%20che%20rappresenta%20una%20funzione%20mediante%20uno%20script%20grafico.%20Fare%20clic%20con%20il%20tasto%20destro%20sul%20grafico%20e%20selezionare%3CEM%3E%20Personalizzare...%3C%2FEM%3E%20Nella%20finestra%20di%20dialogo%20premere%20il%20segno%20pi%C3%B9%20e%20selezionare%3CEM%3E%20Funzione%20Y%3C%2FEM%3E%20nel%3CEM%3E%20Modelli%3C%2FEM%3E%20menu%20a%20discesa.%20Aggiungere%3CEM%3E%20Funzione%20Y(%20y%20%3D%20x%2C%20x%20)%3B%3C%2FEM%3E%20per%20ottenere%20una%20retta%20y%3Dx.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEsempio%20JSL%3A%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200.0px%200.0px%200.0px%200.0px%3B%20color%3A%20%23801392%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FFitness.jmp%22%20)%3B%0Abiv%20%3D%20dt%20%26lt%3B%26lt%3B%20Bivariate(%20Y(%20%3AMaxPulse%20)%2C%20X(%20%3ARunPulse%20)%20)%3B%0AReport(%20Biv%20)%5BFramebox(%201%20)%5D%20%26lt%3B%26lt%3B%20add%20graphics%20script(%20Y%20Function(%20y%20%3D%20x%2C%20x%20)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22margin%3A%200.0px%200.0px%200.0px%200.0px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-794679%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ER%3A%20Come%20aggiungere%20una%20linea%20a%2045%C2%B0%20(y%3Dx)%20al%20grafico%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-794679%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EUtilizzo%20spesso%20una%20linea%201%3A1%20per%20le%20mie%20analisi!%3CBR%20%2F%3E%20Ora%20ho%20aggiunto%20un'icona%20di%20collegamento%20alla%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Add-Ins%2FGraph-Builder-Toolbar%2Fm-p%2F565466%23U565466%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-tkb-thread%20lia-fa-icon%20lia-fa-tkb%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3Ebarra%20degli%20strumenti%20di%20Graph%20Builder%3C%2FA%3E%20%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_0-1725395278996.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1725395278996.png%22%20style%3D%22width%3A%20216px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67858i161BC06EE4F15DFF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_0-1725395278996.png%22%20alt%3D%22hogi_0-1725395278996.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
markschahl
Level VI

How to add 45° (y=x) line to graph?

Does anyone have a smarter way to add a 45° (y=x) line to an x-y plot? I currently do the following:

  1. Set x-axis and y-axis pixels to the same value in the Frame Size dialog
  2. Use the drawing tool to manually add a line to the plot

The line is never quite perfect and has to be adjusted when plot is changed.

JMP Developers: this would be a great option to add to: Y-axis specification, Reference Lines. It is useful when comparing predicted versus actual; lab determinations versus standard values; etc.. Thinking about this more, having the option to enter f(x) for a y-reference line would be even better than just the 45° (y=x) line.

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to add 45° (y=x) line to graph?

In the Fit Y by X platform you can choose Fit special... and lock intercept to zero and slope to one.

 

In most platforms it is also possible to draw a line representing a function by a graphics script. Right-click on the graph and select Customize... In the dialog press the plus sign and select Y Function in the Templates drop-down menu. Add Y Function( y = x, x ); to get a straight y=x line.

 

JSL-example:

 

dt = Open( "$SAMPLE_DATA/Fitness.jmp" );
biv = dt << Bivariate( Y( :MaxPulse ), X( :RunPulse ) );
Report( Biv )[Framebox( 1 )] << add graphics script( Y Function( y = x, x ) );

 

View solution in original post

6 REPLIES 6
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to add 45° (y=x) line to graph?

In the Fit Y by X platform you can choose Fit special... and lock intercept to zero and slope to one.

 

In most platforms it is also possible to draw a line representing a function by a graphics script. Right-click on the graph and select Customize... In the dialog press the plus sign and select Y Function in the Templates drop-down menu. Add Y Function( y = x, x ); to get a straight y=x line.

 

JSL-example:

 

dt = Open( "$SAMPLE_DATA/Fitness.jmp" );
biv = dt << Bivariate( Y( :MaxPulse ), X( :RunPulse ) );
Report( Biv )[Framebox( 1 )] << add graphics script( Y Function( y = x, x ) );

 

pmroz
Super User

Re: How to add 45° (y=x) line to graph?

Very cool.  I tried it in Graph Builder and it works like a charm.  Here's an example:

 

 

dt = open("$sample_data\Boston Housing.jmp");
 
gb = Graph Builder(
    Show Control Panel( 0 ),
    Variables( X( :rooms ), Y( :distance ) ),
    Elements( Points( X, Y, Legend( 1 ) ) ),
    SendToReport(
        Dispatch( {}, "rooms", ScaleBox,
            {Min( 0 ), Max( 12 ), Inc( 2 ), Minor Ticks( 1 )} ),
        Dispatch( {}, "distance", ScaleBox,
            {Min( 0 ), Max( 12 ), Inc( 2 ), Minor Ticks( 1 )} ),
        Dispatch( {}, "Graph Builder", FrameBox,
            {Marker Size( 3 ), Add Graphics Script(
                2, Description( "Script" ), Y Function( x, x )
            ), Grid Line Order( 1 ), Reference Line Order( 3 )} )
    )
);

 

blackeneth
Level III

Re: How to add 45° (y=x) line to graph?

Here is another script using the Bivariate platform (I use JMP 10.0.2):

 

 

dt = Open("$SAMPLE_DATA/Fitness.jmp");
 
dt << Bivariate(
  Y(:MaxPulse),
  X(:RunPulse),
  SendToReport(
  Dispatch(
  {},
  "Bivar Plot",
  FrameBox,
  {Add Graphics Script(2, Description("Script"), YFunction(x, x)),
  Grid Line Order(1), Reference Line Order(3)}
  )
  )
);

 

josh
Level I

Re: How to add 45° (y=x) line to graph?

How can the 45 degree reference line be reformatted as dashes and alternate color?

txnelson
Super User

Re: How to add 45° (y=x) line to graph?

Here is a version of the platform with the line dashed and red

 

 

dt = Open( "$sample_data\Boston Housing.jmp" );
 
gb = Graph Builder(
       Show Control Panel( 0 ),
       Variables( X( :rooms ), Y( :distance ) ),  
       Elements( Points( X, Y, Legend( 1 ) ) ),  
       SendToReport(
              Dispatch( {}, "rooms", ScaleBox, {Min( 0 ), Max( 12 ), Inc( 2 ), Minor Ticks( 1 )} ),
              Dispatch( {}, "distance", ScaleBox, {Min( 0 ), Max( 12 ), Inc( 2 ), Minor Ticks( 1 )} ),
              Dispatch(
                     {},  
                                         "Graph Builder",  
                     FrameBox,  
                     {Marker Size( 3 ), Add Graphics Script(  
                                                     2,  
                           Description( "Script" ),  
                                                     Pen Color( "red" );  
                                                    Line Style( "dashed" );  
                                                   Y Function( x, x );  
                     ), Grid Line Order( 1 ), Reference Line Order( 3 )}
              )
       )  
);

 

 

 

The Graphing Elements are documented in the Scripting Guide, starting on page 497.  The Scripting Guide is available under the JMP Help==>Books==>Scripting Guide.

Jim
hogi
Level XIII

Re: How to add 45° (y=x) line to graph?

I use a 1:1 line so often for my analyses!
Now I added a shortcut icon to Graph Builder Toolbar :

hogi_0-1725395278996.png

 

Recommended Articles