Hallo @Jordan_Hiller , es war schön, Sie beim Discovery Summit 2025 (online) zu treffen.
Ein Problem, unter dem ich immer noch leide:
So weisen Sie Liniendiagrammen Farben zu, insbesondere wenn Linien in Kombination mit Glättungselementen verwendet werden:
Graph Builder. Glätter und Linie kombinieren – wie?

Ich wünschte, diese Option wäre in JMP verfügbar: Graph Builder: Linie – Möglichkeit, Unterbrechungen hinzuzufügen
oder dieses: Graph Builder – Überlagerung durch mehrere Spalten
Hier ist eine weitere interessante Aufgabe – übertragen auf Big Class:
- Ich möchte eine große Anzahl von Kurven einfärben.
Nehmen wir also die Schüler der großen Klasse und tragen den Namen (39 Werte!) auf der x-Achse ein.
Stellen Sie sich vor, dass die Balken tatsächlich Liniendiagramme in verschiedenen Farben sind.
- Ich möchte nicht alle Daten auf einmal sehen, sondern durch die Daten „zappen“ – Alter für Alter
Fügen wir also einen Datenfilter hinzu, um die Ansicht auf ein bestimmtes Alter zu beschränken
- Die Aufgabe: In dieser Ansicht soll jeder (sichtbare) Schüler durch eine eindeutige Farbe dargestellt werden.
Bitte beachten Sie: Das Balkendiagramm besteht aus komplizierten Kurven. Wir möchten also nicht, dass zwei Kurven in einem Diagramm dieselbe Farbe haben.
Wir können den neuen Spaltenpunktzahl() verwenden, der in JMP19 eingeführt wurde: Neu im Graph Builder für JMP 19
so hilfreich! – so einfach zu verwenden! – ein großer Vorteil!
Wir sortieren die Schüler innerhalb einer Altersgruppe alphabetisch
[Die ersten Schüler sind: Jaclyn (Alter: 12), Alice (Alter: 13), die zweiten: James & Barbara ...]
Mit dieser Punktzahl kann eine eindeutige Farbe zugewiesen werden: andere Punktzahl – andere Farbe.
Wenn wir nun die Altersgruppen durchgehen, sehen wir:
keine doppelten Farben in einer der Altersgruppen
(tatsächlich können wir eine bessere Farbskala mit deutlicheren Farben verwenden : )

So weit: Super! Jetzt wollen wir uns dem Problem widmen.
Für dieses Diagramm können Sie die Legende deaktivieren, da sie kaum einen Nutzen bringt – sie zeigt nur den Wert der Hilfsspalte „col score“ an.
Hier sind die Studierenden auf der x-Achse deutlich zu erkennen.
Dies ist jedoch nur ein Dummy-Diagramm. Tatsächlich muss die x-Achse für eine kontinuierliche Variable verwendet werden, und anstelle langweiliger Balkendiagramme erhalten wir komplizierte Kurven. Die „ Studenten “ können nur über die Legende identifiziert werden.
Wie können also die Farbeinstellungen von der Hilfsspalte „col score“ in die Spalte „name“ übertragen werden, sodass die Legende Sinn ergibt?
Alle Vorschläge oder Alternativen sind herzlich willkommen.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
{uniqueColor} = dt << New Formula Column(
Operation( Category( "Aggregate" ), "Score Unique" ),
Columns( :name ),
Group By( :age )
);
uniqueColor<< set name ("uniqueColor");
Graph Builder(
Variables( X( :name ), Color( :uniqueColor ) ),
Elements( Bar( X, Legend( 3 ) ) ),
Local Data Filter( Add Filter( columns( :age ), Where( :age == 12 ) ) )
);
Hallo Holger, es war toll, dich beim Online Discovery Summit zu sehen!
Ich habe einen Hack, den Sie für das erste Problem ausprobieren können – dabei werden die Daten nach Gruppen aufgeteilt. Ich musste die Farben etwas manuell anpassen, aber es war nicht allzu schlimm.

Ich habe Ihr zweites Problem nicht verstanden – vielleicht könnten Sie ein Beispiel mit den betreffenden Kurven statt Balken liefern.
Prost,
Jordanien
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Functional Data/Weekly Weather Data.jmp" );
dt << New Column( "group", Character, "Nominal", Formula( Substr( :STATION, 8, 1 ) ) );
dt << New Column( "DupGroup", Character, "Nominal", Formula( :group ) ) << Run Formulas;
//Split data table
dt2 = dt << Split(
Split By( :group ),
Split( :TAVG ),
Group( :DATE, :STATION ),
Output Table( "SplitByStationDate" ),
Remaining Columns( Keep( :DupGroup ) ),
Sort by Column Property
);
dt2 << Graph Builder(
Size( 636, 564 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables(
X( :DATE ),
Y( :"2"n ),
Y( :"3"n, Position( 1 ) ),
Y( :"4"n, Position( 1 ) ),
Overlay( :STATION, Overlay Encoding( "None" ) ),
Color( :DupGroup )
),
Elements(
Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 6 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Y( 3 ), Overlay( 0 ), Color( 0 ), Legend( 7 ) )
),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model(
6,
Properties( 0, {Line Color( 21 )}, Item ID( "2", 1 ) ),
Properties( 1, {Line Color( 19 )}, Item ID( "3", 1 ) ),
Properties( 2, {Line Color( 20 )}, Item ID( "4", 1 ) ),
Properties( 3, {Line Color( 19 )}, Item ID( "2 (STATION=USW00003195)", 1 ) ),
Properties( 4, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00003195)", 1 ) ),
Properties( 5, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00003195)", 1 ) ),
Properties( 6, {Line Color( 19 )}, Item ID( "2 (STATION=USW00003868)", 1 ) ),
Properties( 7, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00003868)", 1 ) ),
Properties( 8, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00003868)", 1 ) ),
Properties( 9, {Line Color( 19 )}, Item ID( "2 (STATION=USW00003949)", 1 ) ),
Properties( 10, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00003949)", 1 ) ),
Properties( 11, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00003949)", 1 ) ),
Properties( 12, {Line Color( 21 )}, Item ID( "2 (STATION=USW00012924)", 1 ) ),
Properties( 13, {Line Color( 21 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00012924)", 1 ) ),
Properties( 14, {Line Color( 21 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00012924)", 1 ) ),
Properties( 15, {Line Color( 19 )}, Item ID( "2 (STATION=USW00013733)", 1 ) ),
Properties( 16, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00013733)", 1 ) ),
Properties( 17, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00013733)", 1 ) ),
Properties( 18, {Line Color( 19 )}, Item ID( "2 (STATION=USW00013877)", 1 ) ),
Properties( 19, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00013877)", 1 ) ),
Properties( 20, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00013877)", 1 ) ),
Properties( 21, {Line Color( 20 )}, Item ID( "2 (STATION=USW00014751)", 1 ) ),
Properties( 22, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00014751)", 1 ) ),
Properties( 23, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00014751)", 1 ) ),
Properties( 24, {Line Color( 20 )}, Item ID( "2 (STATION=USW00014922)", 1 ) ),
Properties( 25, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00014922)", 1 ) ),
Properties( 26, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00014922)", 1 ) ),
Properties( 27, {Line Color( 20 )}, Item ID( "2 (STATION=USW00024024)", 1 ) ),
Properties( 28, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00024024)", 1 ) ),
Properties( 29, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00024024)", 1 ) ),
Properties( 30, {Line Color( 20 )}, Item ID( "2 (STATION=USW00024144)", 1 ) ),
Properties( 31, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00024144)", 1 ) ),
Properties( 32, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00024144)", 1 ) ),
Properties( 33, {Line Color( 19 )}, Item ID( "2 (STATION=USW00053182)", 1 ) ),
Properties( 34, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00053182)", 1 ) ),
Properties( 35, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00053182)", 1 ) ),
Properties( 36, {Line Color( 21 )}, Item ID( "2 (STATION=USW00092811)", 1 ) ),
Properties( 37, {Line Color( 21 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00092811)", 1 ) ),
Properties( 38, {Line Color( 21 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00092811)", 1 ) ),
Properties( 39, {Line Color( 19 )}, Item ID( "2 (STATION=USW00093067)", 1 ) ),
Properties( 40, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00093067)", 1 ) ),
Properties( 41, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00093067)", 1 ) ),
Properties( 42, {Line Color( 19 )}, Item ID( "2 (STATION=USW00093242)", 1 ) ),
Properties( 43, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00093242)", 1 ) ),
Properties( 44, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00093242)", 1 ) ),
Properties( 45, {Line Color( 19 )}, Item ID( "2 (STATION=USW00093718)", 1 ) ),
Properties( 46, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00093718)", 1 ) ),
Properties( 47, {Line Color( 19 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00093718)", 1 ) ),
Properties( 48, {Line Color( 20 )}, Item ID( "2 (STATION=USW00094626)", 1 ) ),
Properties( 49, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "3 (STATION=USW00094626)", 1 ) ),
Properties( 50, {Line Color( 20 ), Line Style( "Solid" )}, Item ID( "4 (STATION=USW00094626)", 1 ) )
), Legend Model(
7,
Type Properties( 0, "H Line", {Line Width( 5 )} ),
Properties( 0, {Line Color( 21 ), Line Width( 5 )}, Item ID( "Smooth(2)", 1 ) ),
Properties( 1, {Line Color( 19 ), Line Width( 5 )}, Item ID( "Smooth(3)", 1 ) ),
Properties( 2, {Line Color( 20 ), Line Width( 5 )}, Item ID( "Smooth(4)", 1 ) )
)}
)
)
);
per Skript:
fromCol = Name Expr( :uniqueColor );
toCol = Name Expr( :name );
steal my colors( Name Expr( fromCol ), Name Expr( toCol ) )
<BR />// helper labels to sort the entries in the legend by age (not needed with a data filter)<BR />
students= set unique(:name << get values());
myValueLabels =Transform each({student}, students,
Eval Expr((Expr(student) = Expr(Char(:age[where(dt,:name == student)[1]])||"_"||student)))
);
dt:name << Value Labels( myValueLabels ) << Use Value Labels( 1 );

stiehl meine Farben:
steal my colors = Function( {fromCol, toCol}, // fromCol and toCol are "Columns"
//{default local},
write("from column ", Name Expr( fromCol ), "\!n");
write("to ", Name Expr( toCol ) , "\!n");
// Lookup: Name -> UniqueColorID
Eval(
Eval Expr(
Lookup = Current Data Table() << Summary(
Group( Expr( Name Expr( toCol ) ) ),
Mean( Expr( Name Expr( fromCol ) ) ),
statistics column name format( "column" )
)
)
);
// grey values for duplicates (like Robert)
duplicates = As Column( Lookup, 1 )[Where( Lookup, :N Rows > 1 )]; // AsColumn(Lookup,1), not toCol?!? toCol lives in dt !
If(N items(duplicates),ColorsDuplicates = Transform Each( {duplicate}, As List( Index( 1, N Items( duplicates ) ) ),
{255, 255, 255} - duplicate / N Items( duplicates ) * {255, 255, 255}
));
// Lookup: label -> uniqueColorID
AA1 = Associative Array( lookup[0, {1, 3}] ); // 1: label , 3: uniqueColorID
labels = AA1 << get keys;
Close(Lookup, noSave);
// workaround: assign colors to "fromCol" and get them via the column script
// (because I don't know how to get the Nth color from a Color Theme on my own)
Eval(
Eval Expr(
dt << Color or Mark by Column(
Expr( Name Expr( fromCol ) ),
Color Theme( "JMP Blue Red Green" ),
Marker( 0 ),
Continuous Scale( 0 ),
Save To Column Property( 1 )
)
)
);
myScript = fromCol << get script;
// convert colors from a column property
ValueColorsProperty = Extract Expr( myScript, Set Property( "Value Colors", Wild List() ) );
// ... into an Associative Array for the Lookup: uniqueColorID -> color
AA2 = Associative Array( Substitute( Arg( ValueColorsProperty, 2 ), Expr( Assign() ), Expr( List() ) ) );
// for each label, define a color
assignments = Transform Each( {label}, labels,
duplicateID = Contains( duplicates, label );
Eval Expr( // don't execute, just evaluate the left and right part
Expr( label ) = Expr(
If( duplicateID, // duplicate Label? -> grey value
ColorsDuplicates[duplicateID]
,
AA2[AA1[label]]
) // otherwise: look it up via the associative arrays
)
);
);
// assign the settings to the target column
toCol << Set Property( "Value Colors", assignments );
);