4
$\begingroup$

I have this epilog:

Epilog -> {
  Dashed, LightBlue, Line[{{basexhat, 0}, {basexhat, 600}}], 
  Dashed, LightBlue, Line[{{lastxhat, 0}, {lastxhat, 600}}], 
  Text[Style["Yearly rent per sq m", FontFamily -> "Cambria", 
    Opacity[0.7], 12], Scaled[{.5, .9}]]
  }

But it applies the Dashed and LightBlue to the text too, what can I do to make the Dashed and LightBlue only apply to the lines?

When I try to close them in groups:

Epilog -> 
 {Dashed, LightBlue, Line[{{basexhat, 0}, {basexhat, 600}}]}, 
 {Dashed, LightBlue, Line[{{lastxhat, 0}, {lastxhat, 600}}]}, 
 {Text[Style["Yearly rent per sq m", FontFamily -> "Cambria", Opacity[0.7], 12], Scaled[{.5, .9}]]}

The whole graph loses its properties and gives weird results.

$\endgroup$
2
  • $\begingroup$ use { } to enclose the group. $\endgroup$
    – cvgmt
    Commented Sep 30, 2022 at 7:39
  • $\begingroup$ @cvgmt Check my edit $\endgroup$ Commented Sep 30, 2022 at 7:42

1 Answer 1

6
$\begingroup$

You can use braces to introduce scopes for the styles, so something like the following should work:

Epilog -> {
  {
    Dashed, LightBlue, 
    Line[{{basexhat, 0}, {basexhat, 600}}], 
    Line[{{lastxhat, 0}, {lastxhat, 600}}]
  }, 
  Text[Style["Yearly rent per sq m", FontFamily -> "Cambria", Opacity[0.7], 12], Scaled[{.5, .9}]]
 }

This way, the styles will only be applied to the things inside the inner {…}.

$\endgroup$

Your Answer

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

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