Offset etichetta grafico a barre del generatore di graficiIl generatore di grafici può visualizzare le etichette dei valori sui grafici a barre, sfortunatamente, se i dati vengono tracciati anche sul grafico a barre, le etichette vengono completamente oscurate.

Fortunatamente è relativamente semplice riposizionare manualmente le etichette. Ottenere l'allineamento corretto è un po' complicato e farlo più di una volta è relativamente frustrante. Anche modificare lo script del grafico per ottenere gli allineamenti corretti è noioso dopo la seconda o la terza iterazione di un grafico. Con un po' di magia JSL possiamo trovare i fotogrammi e i segmenti delle barre e regolare automaticamente gli offset delle etichette.
Nello script seguente viene aperta una tabella dati di esempio, quindi viene eseguito uno script grafico, seguito da alcune istruzioni di formattazione.
Per utilizzare questo script, sostituisci il riferimento alla tabella dati o rimuovi il commento "dt=current data table();" riga per consentire l'esecuzione dello script nella tabella corrente. Lo script del generatore di grafici è un esempio, puoi utilizzare RTM>Salva script> negli Appunti per ottenere lo script del generatore di grafici e quindi incollarlo al posto dell'esempio.
names default to here(1);
//paste your data table reference here, or just use the current data table.
dt=Open( "$SAMPLE_DATA/Big Class.jmp" );
//dt=current data table();
obj=dt<<
//Paste your graph builder script here
Graph Builder(
Size( 518, 470 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements(
Bar(X,Y,Legend( 4 ),
Error Interval( "Standard Error" ),
Label( "Label by Value" )),
Points( X, Y, Legend( 5 ) )),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model(4,
Properties(0,{Fill Color( 0 ), Fill Pattern( "none" )},Item ID( "Mean", 1 )))}))
);
// End of graph builder script.
//Make a reference for the bar chart segments
fbi= N Items( (obj << xpath( "//FrameBox" )) );
for (ii=1, ii<=fbi, ii++,
frame = Report( obj )[FrameBox( ii )];
seg = (frame << Find Seg( "Bar Seg" ));
//Get variable used for the X axis
vars=obj<< Get Variables();
xx=vars[1];xx[1];
//Find the number of bars (or levels used to make bars)
Summarize( levels = By( eval(xx[1])));
Eval List( levels );
//Build an expression to change the offset
qq=expr(set label offset());
for (i=0, i<=nitems(levels)*fbi, i++, //Note there is a multipler, *fbi. This assumes each level is the same for each frame. Its kind of sloppy, might need to just replace it with a fixed value.
rr={};
insert into (rr, i); //This is the Bar number, starts with zero
insert into (rr,i); //This is the x offset, which is the same as the bar number
insert into(rr, 10); //This is the Y offset
insert into (qq, (rr));
);
//Make magic happen
eval(substitute(expr(seg<<QQ></QQ>
<P> </P>
<P>In un post precedente sul blog ho descritto i passaggi e incluso uno script di automazione per aggiungere barre di errore con annotazioni ai grafici "Dynamite", grafici a barre con una linea di intervallo. <A href="https://community.jmp.com/t5/Byron-Wingerd-s-Blog/One-Way-ANOVA-Figure-for-Scientists/ba-p/265156" target="_blank">https://community.jmp.com/t5/Byron-Wingerd-s-Blog/One-Way-ANOVA-Figure-for-Scientists/ba-p/265156</A></P><LINGO-TEASER id="lingo-teaser-777858" slang="en-US" mode="UPDATE"><P>I tuoi dati oscurano le etichette dei dati?</P></LINGO-TEASER><LINGO-LABS id="lingo-labs-777858" slang="en-US" mode="UPDATE"><LINGO-LABEL>Automazione e scripting</LINGO-LABEL><LINGO-LABEL>Analisi e modellazione dei dati di base</LINGO-LABEL><LINGO-LABEL>Esplorazione e visualizzazione dei dati</LINGO-LABEL><LINGO-LABEL>Condivisione e comunicazione dei risultati</LINGO-LABEL></LINGO-LABS>Re: Etichetta del grafico a barre del generatore di grafici correttaCiao @Byron_JMP , bel trucco. Molto utile.
in alternativa si potrebbero aggiungere le etichette a un secondo elemento del grafico a barre:
dt=Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
Size( 563, 522 ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables( X( :age ), Y( :height ) ),
Elements(
Bar( X, Y, Legend( 4 ), Error Interval( "Standard Error" ) ),
Points( X, Y, Legend( 5 ) ),
Bar( X, Y, Legend( 6 ), Bar Style( "Float" ), Label( "Label by Value" ) )
)
);
Ho spesso un problema correlato: non c'è spazio per le etichette orizzontali:

Esiste una soluzione alternativa tramite JSL per ruotare le etichette?
Re: Etichetta del grafico a barre del generatore di grafici correttaSembra che ti piacerebbe ruotare le etichette in questo modo:

Non ci avrei provato senza la tua domanda. Esiste un JSL oscuro che ti consente di impostare le proprietà del carattere E l'angolo. Onestamente non l'ho mai visto fare prima e sembra davvero fantastico.
Il JSL è questo: Set Font( "" , 18 , "" , 90 ). Il carattere è "", la dimensione è 18 punti, la formattazione è "", e l'angolo è 90. Nell'indice di scripting dell'esempio sono specificati il carattere e la formattazione, ma la loro sostituzione con "", sembra utilizzare il predefinito. Cambiando l'angolo a -90 il testo viene letto dal basso verso l'alto.
names default to here(1);
//paste your data table reference here, or just use the current data table.
dt=Open( "$SAMPLE_DATA/Big Class.jmp" );
//dt=current data table();
obj=dt<<
//Paste your graph builder script here
Graph Builder(
Size( 518, 470 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements(
Bar(X,Y,Legend( 4 ),
Error Interval( "Standard Error" ),
Label( "Label by Value" )),
Points( X, Y, Legend( 5 ) )),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model(4,
Properties(0,{Fill Color( 0 ), Fill Pattern( "none" )},Item ID( "Mean", 1 )))}),
Dispatch( {}, "Graph Builder", FrameBox,
{DispatchSeg(
BarSeg( 1 ),
Set Font( "", 18, "", 90 )
)}
)
)
);
// End of graph builder script.
//Make a reference for the bar chart segments
fbi= N Items( (obj << xpath( "//FrameBox" )) );
for (ii=1, ii<=fbi, ii++,
frame = Report( obj )[FrameBox( ii )];
seg = (frame << Find Seg( "Bar Seg" ));
//Get variable used for the X axis
vars=obj<< Get Variables();
xx=vars[1];xx[1];
//Find the number of bars (or levels used to make bars)
Summarize( levels = By( eval(xx[1])));
Eval List( levels );
//Build an expression to change the offset
qq=expr(set label offset());
for (i=0, i<=nitems(levels)*fbi, i++, //Note there is a multipler, *fbi. This assumes each level is the same for each frame. Its kind of sloppy, might need to just replace it with a fixed value.
rr={};
insert into (rr, i); //This is the Bar number, starts with zero
insert into (rr,i); //This is the x offset, which is the same as the bar number
insert into(rr, 10); //This is the Y offset
insert into (qq, (rr));
);
//Make magic happen
eval(substitute(expr(seg<<QQ></QQ>
<P> </P>Re: Offset etichetta grafico a barre del generatore di graficiFreddo! Sorprendente!
Grazie.
Re: Offset etichetta grafico a barre del generatore di graficiMhm...
Mi chiedevo solo come sono riuscito a allontanare le etichette dalla parte superiore del grafico... senza JSL.
-> Ah: JMP17!
Quindi, come altra soluzione alternativa per " Offset etichetta grafico a barre ":
torna a JMP 17 e all'età dell'utente sull'asse x come Overlay :
// JMP 17!
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << new column("one", set each value(1));
dt << Graph Builder(
Variables( X( :age ), Y( :height ), Overlay( :age ), Color( :one ) ),
Elements(
Bar(
X,
Y,
Legend( 1 ),
Summary Statistic( "Mean" ),
Error Interval( "Standard Error" ),
Label( "Label by Value" )
),
Points( X, Y, Overlay( 0 ), Legend( 2 ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
1,
Properties(
0,
{Fill Color( 0 ), Fill Pattern( "none" )},
Item ID( "1", 1 )
)
), Legend Model(
2,
Properties( 0, {Line Color( 0 )}, Item ID( "1", 1 ) )
)}
)
)
);

svantaggi:
- Sembra che ci sia un bug con le barre di errore che è stato risolto con JMP18.
- nessuna delle altre fantastiche funzionalità di JMP 18.
Re: Offset etichetta grafico a barre del generatore di graficiPensando a tutti gli utenti JMP senza esperienza JSL...
In realtà, dovrebbe esserci un controllo per il posizionamento delle etichette direttamente nella GUI.
Ah, c'è un augurio per il 2020 di @ shampton82 con questa idea:
Controllo dell'etichetta dati del grafico a barre del generatore di grafici
Re: Offset etichetta grafico a barre del generatore di graficiGrazie per aver collegato questo blog e l'elemento della lista dei desideri @hogi ! Anche se è fantastico poter aggiungere così tante funzionalità con JSL, una delle cose più imbarazzanti quando si mette in mostra JMP è non essere in grado di fare cose molto basilari con le personalizzazioni dei grafici che gli utenti possono fare in Excel (e sono così abituati, gli lascia a bocca aperta che non sia possibile farlo facilmente in JMP).
@Byron_JMP Collabora con il team JMP per far sì che questa fantastica personalizzazione diventi non basata su JSL!
Steve
Re: Offset etichetta grafico a barre del generatore di graficiEssere d'accordo.
Re: Offset etichetta grafico a barre del generatore di graficiHo appena scoperto qual è la differenza tra JMP 17 e JMP18:
si ottiene l'etichetta centrata in JMP18 quando si passa alla modalità Stacked .
Sfortunatamente questa modalità non è compatibile con le barre degli errori.
Quindi, è necessario aggiungere le barre di errore con un altro grafico a barre mobile.
In totale:

100% GUI - 0% script.
ecco la sceneggiatura:
Visualizza altro...Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
Size( 521, 429 ),
Variables( X( :age ), Y( :height ) ),
Elements(
Points( X, Y, Legend( 2 ) ),
Bar(
X,
Y,
Bar Style( "Stacked" ),
Summary Statistic( "Mean" ),
Label( "Label by Value" )
),
Bar(
X,
Y,
Bar Style( "Float" ),
Summary Statistic( "Mean" ),
Error Interval( "Standard Error" )
)
)
);
... Spero che questo post non venga utilizzato per difendere la nuova funzionalità per specificare la posizione dell'etichetta .
Re: Offset etichetta grafico a barre Graph BuilderGrazie per questi post. Saranno utili.
Re: Offset etichetta grafico a barre Graph BuilderUn grafico Heatmap ha anche un "seg" con cui comunicare?
non presente in questa lista:

si chiama Heatmap Cells Seg ?
myseg << get description = "Heatmap Cells";
-> no.
Re: Offset etichetta grafico a barre Graph BuilderRettangolo.
Sfortunatamente, Heatmap Seg = Rect Seg è piuttosto sordo : (