Message Boards Message Boards

0
|
3668 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Add custom Labels in a plot?

Dear all.

I have the plot below and want to move the label (b) into the left-handed corner outside the plot, so that it is located above the label "y coordinate" but not inside the inner area of the plot. How can I do this?

I fiddled around with Overlay or using a negative x - coordinate in Text, but both did not work. Any sugggestions?

Plot[Sin[x], {x, 0, 4*2*\[Pi]}, Frame -> True, PlotRange -> All, 
 PlotStyle -> Directive[Blue, Thickness[0.004]], ImageSize -> 300, 
 FrameStyle -> Directive[Black, Thickness[0.003]], 
 LabelStyle -> Directive[Black, 10], 
 FrameLabel -> {"x coordinate", "y coordinate"}, 
 Epilog -> Text[Style["(b)", 10], {0.7, 0.95}]]
POSTED BY: Markus Schmidt
3 Replies

Works nicely. Thanks.

POSTED BY: Markus Schmidt

This looks nice, didn't think of this option. Will try and give you feedback. Thanks, Markus

POSTED BY: Markus Schmidt

How about FrameLabel -> {"x coordinate", "y coordinate (b)"}. Otherwise you can place the sinusoid as an inset in Graphics:

sinusoid = 
  Plot[Sin[x], {x, 0, 4*2*\[Pi]}, Frame -> True, PlotRange -> All, 
   PlotStyle -> Directive[Blue, Thickness[0.004]], ImageSize -> 300, 
   FrameStyle -> Directive[Black, Thickness[0.003]], 
   LabelStyle -> Directive[Black, 10], 
   FrameLabel -> {"x coordinate", 
     Row[{"y coordinate   ", Rotate[ "(b)", -Pi/2]}]}];
Graphics[{Text[Style["(b)", 10, Red], {0, 1}], 
  Inset[sinusoid, {.1, .95}, {0, 1}]}, PlotRange -> {{0, 1}, {0, 1}}, 
 PlotRangePadding -> .1]

You will have to play with the parameters to get the composition you like.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract