6
$\begingroup$

I want to use ColorData colors along with other manual options. Is that possible?

SeedRandom["ColorData problem aah help"]
data=RandomVariate[LogisticDistribution[.007,.01],{1200,2}];
dataClustered=FindClusters[data,4,DistanceFunction->EuclideanDistance];
ListPlot[dataClustered,PlotStyle->"PlumColors"]

enter image description here

But I would also like to add:

Directive[Opacity->.3,PointSize->.015]

I can't seem to add the Directive without losing the colors.

$\endgroup$
5
$\begingroup$
ListPlot[dataClustered, 
 PlotStyle -> Thread[{ColorData["PlumColors"] /@ Rescale[Range@Length@dataClustered], 
  Opacity[.3], PointSize[.015]}]]

enter image description here

Alternatively, you can use:

PlotStyle -> (Directive[ColorData["PlumColors"]@#, Opacity[.3], 
     PointSize[.015]] & /@ Rescale[Range@Length@dataClustered])
$\endgroup$
  • $\begingroup$ Holy Plot that was quick... Thanks a lot, this does the job perfectly. I didn't realize ColorData was a function. $\endgroup$ – EBassal Nov 24 '17 at 20:33
  • $\begingroup$ @EBassal, my pleasure. Thank you for the accept. $\endgroup$ – kglr Nov 24 '17 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.