2
$\begingroup$

Want to set point text label colors to match actual points. Should be obvious but...

Workaround is to change ALL label coloring but this is not desired. Would like to have black axis labels.

Also should be able to do this without combining plots with Show but I cannot determine the syntax.

rawfiber705 = {{145.1, 40.2}, {150, 33.4}, {148.7, 42.3}, {145, 39.9}, {142, 29.9},  {142.5, 37.9}}
rawfiber390 = {  {146.6, 35.1},  {150.9, 28.2},  {152.4, 36.8},  {146.6, 35.3},  {141.3, 25.5},  {147, 32.2}}

SetOptions[ListPlot, GridLines -> Automatic, Frame -> True,  PlotRange -> All, PlotStyle -> Thick,  BaseStyle -> {FontFamily -> "Gill Sans MT", FontSize -> 14}, LabelStyle -> Directive[Red, Bold], ImageSize -> 500];
ListPlot[(# - rawfiber705[[1]]) & /@ rawfiber705 -> {"0", "Pcw", "Pccw", "0", "Rcw", "Rccw"}, PlotStyle -> Red]

SetOptions[ListPlot, GridLines -> Automatic, Frame -> True, PlotRange -> All, PlotStyle -> Thick, BaseStyle -> {FontFamily -> "Gill Sans MT", FontSize -> 14}, LabelStyle -> Directive[Blue, Bold], ImageSize -> 500];
ListPlot[(# - rawfiber390[[1]]) & /@ rawfiber390 -> {"0", "Pcw", "Pccw", "0", "Rcw", "Rccw"}, PlotStyle -> Blue]

Show[%,%%]
$\endgroup$

2 Answers 2

3
$\begingroup$
rawfiber705 = {{145.1, 40.2}, {150, 33.4}, {148.7, 42.3}, {145, 
    39.9}, {142, 29.9}, {142.5, 37.9}};
rawfiber390 = {{146.6, 35.1}, {150.9, 28.2}, {152.4, 36.8}, {146.6, 
    35.3}, {141.3, 25.5}, {147, 32.2}};

SetOptions[ListPlot, GridLines -> Automatic, Frame -> True, 
  PlotRange -> All, PlotStyle -> Thick, 
  BaseStyle -> {FontFamily -> "Gill Sans MT", FontSize -> 14}, 
  ImageSize -> 500];

labels = {"0", "Pcw", "Pccw", "0", "Rcw", "Rccw"};

ListPlot[{
  (# - rawfiber705[[1]]) & /@ 
    rawfiber705 -> (Style[#, Red, Bold] & /@ labels),
  (# - rawfiber390[[1]]) & /@ 
    rawfiber390 -> (Style[#, Blue, Bold] & /@ labels)},
 PlotStyle -> {Red, Blue}]

enter image description here

$\endgroup$
2
$\begingroup$

Also

data1 = (# - rawfiber705[[1]]) & /@ rawfiber705;
data2 = (# - rawfiber390[[1]]) & /@ rawfiber390;
styles = {Red, Blue};
labeleddata = Join@@(Thread /@ Thread[{{data1, data2}, Thread[{labels, #}] & /@ styles}]);
newdata = Callout[Style[#, #2[[2]]], Style @@ #2] & @@@ labeleddata;
options = {GridLines -> Automatic, Frame -> True, PlotRange -> All,  PlotStyle -> Thick, 
 BaseStyle -> {FontFamily -> "Gill Sans MT",  FontSize -> 14}, ImageSize -> 500};

ListPlot[newdata, options]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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