Bar e Errorbar Colors for Forest Plot?Sto creando trame forestali e ho inventato due stili:

Sto cercando di controllare il colore delle barre, dei punti e delle barre di errore attraverso i colori delle righe:

La mia domanda è: perché le barre piene e le barre di errore non sono nel colore desiderato?
dt = New Table( "Forest Plot", Add Rows( 5 ),
New Column( "EVENT_NAME", Character( 20 ), "Nominal",
Set Values( {"AAAAAAA", "BBBBBBB", "CCCCCCC", "DDDDDDD", "EEEEEEE"} ) ),
New Column( "DISPROP025", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[5.3766744840813, 1.28687381477736, 5.96303490967794, 1.55531597890029, 2.34164191312678] ) ),
New Column( "DISPROP", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[5.76756983251198, 1.49287821887835, 7.02941951612351, 3.83591362397761, 2.62194430908125] ) ),
New Column( "DISPROP975", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[6.06935482201811, 1.66251397924122, 7.91895228410917, 6.92389142535734, 2.84619058478479] ) ),
New Column( "Alert", Character, "Nominal",
Formula( If( :DISPROP025 > 1 & :DISPROP > 2, "Y", "N" ) ) ),
Set Row States( [13568, 13056, 13568, 13568, 13568] )
);
// Bars + central point
dt << Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP, Position( 1 ) ),
X( :DISPROP975, Position( 1 ) ),
Y( :EVENT_NAME )
),
Elements(
Bar( X( 1 ), X( 3 ), Y, Legend( 9 ), Bar Style( "Range" ) ),
Points( X( 2 ), Y, Legend( 10 ), Jitter( 0 ) )
),
SendToReport(
Dispatch( {}, "DISPROP025", ScaleBox,
{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
)
);
// Error bars
dt << Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP, Position( 1 ) ),
X( :DISPROP975, Position( 1 ) ),
Y( :EVENT_NAME )
),
Elements(
Bar( X( 1 ), X( 3 ), Y, Legend( 9 ), Bar Style( "Interval" ) ),
Points( X( 2 ), Y, Legend( 10 ), Jitter( 0 ) )
),
SendToReport(
Dispatch( {}, "DISPROP025", ScaleBox,
{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
)
);Ri: Bar e Errorbar Colors for Forest Plot?Questa è una soluzione intelligente che è "abbastanza vicina per il lavoro del governo". Ho ispessito le linee con una larghezza di 2 e il leggero sfalsamento non è evidente. Grazie Chris!
Ri: Bar e Errorbar Colors for Forest Plot?Beh, dannazione. Un altro modo è impilare le colonne DISPROP in una e rendere continua la colonna di valori (denominata dati nello script sottostante). Quindi usa questo script
Graph Builder(
Size( 992, 630 ),
Show Control Panel( 0 ),
Variables( X( :Data ), Y( :EVENT_NAME ), Overlay( :Alert ) ),
Elements(
Points(
X,
Y,
Legend( 5 ),
Jitter( 0 ),
Summary Statistic( "Median" ),
Error Bars( "Range" )
)
),
SendToReport(
Dispatch( {}, "Data", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} )
)
);

È vicino, ma c'è ancora qualcosa in più sulla linea della griglia e sui punti dati che usano la sovrapposizione
Ri: Bar e Errorbar Colors for Forest Plot?Ancora nessuna gioia. Sembra che quando c'è un mix di avvisi Y e N, le barre di errore siano sfalsate dalla griglia.

Ecco il codice:
Graph Builder(
Size( 726, 451 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP975, Position( 1 ) ),
X( :DISPROP, Position( 1 ) ),
Y( :EVENT_NAME ),
Overlay( :Alert )
),
Elements(
Bar( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 8 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch( {}, "DISPROP025", ScaleBox,
{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 1 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "400", ScaleBox,
{Legend Model(
8,
Properties( 0, {Line Color( 51 ), Line Width( 2 )} ),
Properties( 1, {Line Color( 51 ), Marker( "FilledCircle" )} ),
Properties( 2, {Line Color( 53 ), Line Width( 2 )} ),
Properties( 3, {Line Color( 53 ), Marker( "FilledCircle" )} )
)}
)
)
);
Ri: Bar e Errorbar Colors for Forest Plot?La chiave per usare l'overlay è di non avere l'elemento del grafico Punti aggiunto. Clicca sui punti Icont in alto per disattivarlo. Quindi opzioni barra / casella di analisi in basso a sinistra, metti un segno di spunta accanto alla variabile DISPROP. I punti non verranno aggiunti in linea con la barra di errore.
Ri: Bar e Errorbar Colors for Forest Plot?Un altro puzzle: quando trascino la colonna Alert nel ruolo Overlay, posso controllare i colori in modo corretto. Tuttavia i punti sono sulle linee orizzontali ma le barre di errore non lo sono. Qualche modo per correggere questo? Se trascino Alert sul ruolo Color non c'è "jitter", ma non riesco a impostare il colore delle barre di errore.

Ri: Bar e Errorbar Colors for Forest Plot?Grazie Chris. Ho fatto una ricerca di Forest Plots e l'addin molto carino di Richard non si è presentato. Mi piace anche la tua soluzione di codifica.
Ri: Bar e Errorbar Colors for Forest Plot?Aspetta, ho trovato un modo. Se apri il pannello di controllo e vai alla sezione detta barra in fondo, ci sarà una sezione varialbe. Aprilo e controlla tutte le variabili. un punto apparirà dove lo vuoi Rimuovi l'elemento punti dal grafico. Quindi utilizzare la variabile di avviso per la sovrapposizione.
Quindi la sceneggiatura sarebbe simile a questa
Graph Builder(
Size( 606, 564 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP, Position( 1 ) ),
X( :DISPROP975, Position( 1 ) ),
Y( :EVENT_NAME ),
Overlay( :Alert )
),
Elements(
Bar( X( 1 ), X( 3 ), X( 2 ), Y, Legend( 9 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch(
{},
"DISPROP025",
ScaleBox,
{Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
9,
Properties( 0, {Line Color( 6 )} ),
Properties( 1, {Marker( "Dot" )} ),
Properties( 2, {Line Color( -5682409 )} ),
Properties( 3, {Marker( "Dot" )} )
)}
),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
)
);Ri: Bar e Errorbar Colors for Forest Plot?Potrebbe essere necessario utilizzare la variabile di avviso per colorare. Funziona sul grafico a barre ma non sul grafico a barre degli errori. Il colore della barra degli errori è controllato dal colore della legenda. Non sai come script diversi colori per diverse barre di errore.Ri: Bar e Errorbar Colors for Forest Plot?Ciao,
Hai dato un'occhiata al componente aggiuntivo di Richard Zink sui terreni forestali?
https://community.jmp.com/t5/JMP-Add-Ins/Forest-Plot-Add-In/ta-p/23977
Poiché il componente aggiuntivo è essenzialmente un file zip, puoi rinominare l'estensione del file in .zip e decomprimerlo. Lì puoi vedere la sua JSL e forse usarne una parte.
Chris