From: Luci Ellis on 23 Jan 2010 07:33 Dear all, I'm putting together a package to automate some of the specific time series and bar chart styles used by my employer. Ultimately I hope to be able to set it up as a palette/package combination to provide a GUI that can used in Player Pro. There are many things I am still struggling with. One of them is how to define standardised indexed color schemes different to the ones that come built into Mathematica. The idea is that users could choose one of our standard sets of colors in a (say) ColorScheme option to the XYZLineChart and XYZBarChart functions I have written, where XYZ is the acronym of my employer, which you can probably guess by Googling. In other words, what I'm looking for is a way to define XYZColors[n] as an indexed color scheme, so that: XYZLineChart[data, ColorScheme->XYZColors[3] PlotStyle->{Directive[AbsoluteThickness[2],Dashed], AbsoluteThickness[1]}] results in DateListPlot[data, Joined->True, PlotStyle->{Directive[XYZColors[3][1], AbsoluteThickness[2],Dashed], Directive[XYZColors[3][1], AbsoluteThickness[1]] } , multiple_other_options_defined_in_XYZLineChart]
From: Luci Ellis on 24 Jan 2010 05:37 On 2010-01-23 23:33:12 +1100, Luci Ellis said: > Dear all, > I'm putting together a package to automate some of the specific time > series and bar chart styles used by my employer. Ultimately I hope to > be able to set it up as a palette/package combination to provide a GUI > that can used in Player Pro. > > There are many things I am still struggling with. One of them is how to > define standardised indexed color schemes different to the ones that > come built into Mathematica. The idea is that users could choose one of > our standard sets of colors in a (say) ColorScheme option to the > XYZLineChart and XYZBarChart functions I have written, where XYZ is the > acronym of my employer, which you can probably guess by Googling. > > In other words, what I'm looking for is a way to define XYZColors[n] as > an indexed color scheme, so that: > > XYZLineChart[data, ColorScheme->XYZColors[3] > PlotStyle->{Directive[AbsoluteThickness[2],Dashed], > AbsoluteThickness[1]}] > > results in > > DateListPlot[data, Joined->True, PlotStyle->{Directive[XYZColors[3][1], > AbsoluteThickness[2],Dashed], Directive[XYZColors[3][1], > AbsoluteThickness[1]] } , > multiple_other_options_defined_in_XYZLineChart] Of course, the code above should read > PlotStyle->{Directive[XYZColors[3][1], > AbsoluteThickness[2],Dashed], Directive[XYZColors[3][2], > AbsoluteThickness[1]] } I didn't fix before posting for the same reason I didn't sign off on the previous post: misdirected mouse-clicking on the Send button too soon. My apologies. Regards, Luci
From: Sjoerd C. de Vries on 24 Jan 2010 05:40 Hi Luci, The following is an example of the defintion of an indexed color function: ColorDataFunction[10,"Indexed",List[1,11,1], Function[Part[List[ RGBColor[0.6980392156862745`,0.01568627450980392`,0.`], RGBColor[0.9215686274509803`,0.49411764705882355`, 0.43137254901960786`], RGBColor[0.9372549019607843`,0.6274509803921569`, 0.16862745098039217`], RGBColor[0.9921568627450981`,0.8156862745098039`, 0.49019607843137253`], RGBColor[0.7254901960784313`,0.8`,0.07058823529411765`], RGBColor[0.3176470588235294`,0.49019607843137253`, 0.0784313725490196`], RGBColor[0.17254901960784313`,0.3607843137254902`, 0.07058823529411765`], RGBColor[0.3607843137254902`,0.40784313725490196`, 0.5333333333333333`], RGBColor[0.22745098039215686`,0.23921568627450981`, 0.45098039215686275`], RGBColor[0.09803921568627451`,0.06666666666666667`, 0.25098039215686274`], RGBColor[0.5607843137254902`,0.5254901960784314`, 0.5647058823529412`]], Mod[Floor[Slot[1]],11,1]]]] Cheers -- Sjoerd On Jan 23, 2:33 pm, Luci Ellis <l...(a)verbeia.com> wrote: > Dear all, > I'm putting together a package to automate some of the specific time > series and bar chart styles used by my employer. Ultimately I hope to > be able to set it up as a palette/package combination to provide a GUI > that can used in Player Pro. > > There are many things I am still struggling with. One of them is how to > define standardised indexed color schemes different to the ones that > come built into Mathematica. The idea is that users could choose one of > our standard sets of colors in a (say) ColorScheme option to the > XYZLineChart and XYZBarChart functions I have written, where XYZ is the > acronym of my employer, which you can probably guess by Googling. > > In other words, what I'm looking for is a way to define XYZColors[n] as > an indexed color scheme, so that: > > XYZLineChart[data, ColorScheme->XYZColors[3] > PlotStyle->{Directive[AbsoluteThickness[2],Dashed], > AbsoluteThickness[1]}] > > results in > > DateListPlot[data, Joined->True, PlotStyle->{Directive[XYZColors[3][1], > AbsoluteThickness[2],Dashed], Directive[XYZColors[3][1], > AbsoluteThickness[1]] } , > multiple_other_options_defined_in_XYZLineChart]
From: Luci Ellis on 26 Jan 2010 06:25 Dear Sjoerd, On 2010-01-24 21:40:14 +1100, Sjoerd C. de Vries said: > Hi Luci, > > The following is an example of the defintion of an indexed color > function: > > <snip> > > Cheers -- Sjoerd > Thanks so much! This is perfect! Best regards, Luci
From: Luci Ellis on 26 Jan 2010 06:43 On 2010-01-24 21:40:14 +1100, Sjoerd C. de Vries said: > Hi Luci, > > The following is an example of the defintion of an indexed color > function: > > ColorDataFunction[10,"Indexed",List[1,11,1], > Function[Part[List[ > <Snip> > Mod[Floor[Slot[1]],11,1]]]] > > Cheers -- Sjoerd > > On Jan 23, 2:33 pm, Luci Ellis <l...(a)verbeia.com> wrote: >> Dear all, >> I'm putting together a package to automate some of the specific time >> series and bar chart styles used by my employer. Ultimately I hope to >> be able to set it up as a palette/package combination to provide a GUI >> that can used in Player Pro. >> >> There are many things I am still struggling with. One of them is how to >> define standardised indexed color schemes different to the ones that >> come built into Mathematica. The idea is that users could choose one of >> our standard sets of colors in a (say) ColorScheme option to the >> XYZLineChart and XYZBarChart functions I have written, where XYZ is the >> acronym of my employer, which you can probably guess by Googling. >> >> In other words, what I'm looking for is a way to define XYZColors[n] as >> an indexed color scheme, so that: >> >> XYZLineChart[data, ColorScheme->XYZColors[3] >> PlotStyle->{Directive[AbsoluteThickness[2],Dashed], >> AbsoluteThickness[1]}] >> >> results in >> >> DateListPlot[data, Joined->True, PlotStyle->{Directive[XYZColors[3][1], >> AbsoluteThickness[2],Dashed], Directive[XYZColors[3][1], >> AbsoluteThickness[1]] } , >> multiple_other_options_defined_in_XYZLineChart] I now realise that Sjoerd's post doesn't contain the full solution. It is the definition for an _existing_ indexed color scheme already defined in Mathematica. I would like to define new ones, perhaps with a different "class" (here, XYZ), or alternatively as an additional "Indexed" color scheme. There just doesn't seem to be a way to extend the Mathematica color scheme facility with schemes that work the same as the built-in ones. XYZColors1 = ColorDataFunction["XYZ1", "XYZ", List[1, 5, 1], Function[Part[List[ RGBColor[92./255, 240./255, 251./255], RGBColor[250./255, 104./255, 35./255], RGBColor[169./255, 174./255, 250./255], RGBColor[17./255, 238./255, 35./255], RGBColor[255./255, 71./255, 251./255] ], Mod[Floor[Slot[1]], 5, 1]]] ] Any suggestions? Regards, Luci
|
Next
|
Last
Pages: 1 2 Prev: How to calculate covariant derivative by Mathematica? Next: Using "If" and "NDSolve" together |