1
$\begingroup$

enter image description here

One of the AxesLabel is "$:\text{log}|\Phi8b(u)|\color{Red}{\text{Red}}$".

Question: How to make it like: "$\color{Red}{\text{Red}}:\text{log}|\Phi8b(u)|$"?.

My Mathematica commads:

Φ8[u_] := Sin[u]; 

Φ8b[u_] := Sin[u] + 1/10; 

Plot[{Log[Abs[Φ8[u]]], Log[Abs[Φ8b[u]]]}, {u, 0, 2*Pi}, 
  PlotStyle -> {{Thick, Blue}, {Thick, Red, Dashed}}, 
  AxesLabel -> 
    {u, {Style["Blue", {Blue, Bold}]*":log|Φ8(u)|", 
         Style["Red",  {Red, Bold}]*" :log|Φ8b(u)|"}}]
$\endgroup$
  • 1
    $\begingroup$ Can you post the code as copy-paste-ble text. It would be easier to handle. $\endgroup$ – Mats Granvik Oct 19 '14 at 16:31
  • $\begingroup$ @MatsGranvik Thanks for the reply! $\endgroup$ – mike Oct 19 '14 at 16:54
  • 1
    $\begingroup$ This would be better suited at Mathematica.SE. $\endgroup$ – Ali Caglayan Oct 19 '14 at 16:55
  • 1
    $\begingroup$ Try imposing order on your label (e.g. using Row): Row[{Style["Red", {Red, Bold}], ": log|f(u)|"}]. As it is, Mathematica reorders your expression by default. $\endgroup$ – Yves Klett Oct 20 '14 at 9:09
  • 1
    $\begingroup$ As nobody has mentioned the elephant in the room, I will. You have expressed your label text as a multiplication and Mathematica is doing its normal lexical reordering on it. $\endgroup$ – m_goldberg Oct 20 '14 at 15:57
2
$\begingroup$
Plot[{Log[Abs[\[CapitalPhi]8[u]]], Log[Abs[\[CapitalPhi]8b[u]]]}, {u, 0, 2*Pi},
 PlotStyle -> {{Thick, Blue}, {Thick, Red, Dashed}},
 AxesLabel -> Row[{
    Style["Blue", {Blue, Bold}], ":log|\[CapitalPhi]8(u)|",
    Style["  Red", {Red, Bold}], ":log|\[CapitalPhi]8b(u)|"}]]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks a lot. It worked with Mathematica V7.0. $\endgroup$ – mike Oct 20 '14 at 16:30
2
$\begingroup$

I am not sure what the ultimate aim is but for motivation:

p = Plot[{Log[Abs[\[CapitalPhi]8[u]]], 
    Log[Abs[\[CapitalPhi]8b[u]]]}, {u, 0, 2*Pi}, 
   PlotStyle -> {{Thick, Blue}, {Thick, Red, Dashed}}, 
   PlotLegends -> LineLegend["Expressions"]];
rp = ReplacePart[
  p, {2, 1, 2} -> 
   Inner[Style[#1, #2] &, p[[2, 1, 2]], {Blue, Red}, List]]

enter image description here

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Will this work with V7? $\endgroup$ – Yves Klett Oct 20 '14 at 12:10
  • 1
    $\begingroup$ @YvesKlett doh...was too focused on changing LabelStyle completely missed the point...v7...in short NO...perhaps will motivate similar 'looking under hood':) $\endgroup$ – ubpdqn Oct 20 '14 at 12:15
  • 1
    $\begingroup$ Eek... the old legends package was not all that easy to work with :D $\endgroup$ – Yves Klett Oct 20 '14 at 12:19
  • $\begingroup$ This is exactly what I want. But it did not work for V7. Thanks a lot! $\endgroup$ – mike Oct 20 '14 at 16:32

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