Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Text position in matlab plot

  1. Oct 20, 2015 #1
    I want to have three plot 1,2,3 in Matlab with the symbols (a), (b) and (c) on plots 1, 2 and 3 respectively.I can do it by text('(a)'), text('(b)'), text('(c)') on the plot 1,2 and 3 respectively but I want to have the three symbols on the same position on the three plots for example northwest of all the plots. Since the three plots don't have the same scale, I can not do this by the command text(x,y,'(a)','FontSize',15) because I don't know the equivalent (x,y) on the three plots with different scales. In other words, I want the positions of the three symbols coincide when I put the three figures over each other.
     
  2. jcsd
  3. Oct 22, 2015 #2

    kreil

    User Avatar
    Gold Member

    I believe you just need to use the Position and Units name value pairs for the text function.

    If you use normalized units then the lower left becomes (0,0) and the top right (1,1).

    http://www.mathworks.com/help/matlab/ref/text.html#inputarg_Position

    I think it will look like this for top left (northwest), which would be something like [0.1 0.8] in normalized units:

    Code (Text):
    text('Units', 'normalized', 'Position', [0.1 0.8], 'String', 'a/b/c')
     
    Last edited: Oct 22, 2015
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Text position in matlab plot
  1. Plotting in MATLAB (Replies: 8)

  2. Plotting with MATLAB (Replies: 1)

  3. MatLab Plot (Replies: 6)

Loading...