Context
More often than not I end up doing plots one after the other so that I have a set of plots with the same colour style. When I want to make it more publishable ready, I would like to reassign colours to each line.
How to assign colours from a given style to existing sets of plots?
Example
pl1= Plot[Sin[x],{x,0,4Pi}];
pl2= Plot[Cos[2x],{x,0,4Pi}];
Show[pl1,pl2];
Attempt
I while back I wrote the following function
Clear[ShowColor];
ShowColor[list___]:=ShowColor[{list}]/; Length[{list}]>1;
ShowColor[list_,ColorRange->color__,opt___]:= Module[{len=Length[list]},
Table[list[[i]] /. RGBColor[_,_,_]->
GradientColor[color][(i-1)/(len-1)],{i,len}]//Show[#,opt]&]
ShowColor[list_,opt___]:= Module[{len=Length[list]},
Table[list[[i]] /. RGBColor[_,_,_]->
GradientColor[ColorData[10] /@ Range[10]][(i-1)/(len-1)],{i,len}]//Show[#,opt]&]
which uses the GradientColor Package, so that
ShowColor[{pl1,pl2}]
produces
But I am left with the impression that it could be done more elegantly and generally with the modern version of Mathematica, making use of the set of default styles and working in harmony with other features.
Also, my implementation is not very robust. For instance,
Show[pl1, pl2] // ShowColor
fails.
What would be great would be to have a function which e.g. would take standard Options such as
ShowColor[plots,PlotStyle-> ColorData[10]]
or
ShowColor[plots,PlotStyle-> Directive[{Dashed,Blue}]]
Any suggestion on how to make this as generic as possible?
Thanks!