Skip to main content

All Questions

3 votes
1 answer
531 views

Adjusting the legend spacing in Matlab

I have slightly lengthy legend titles as shown in the figure below. Is there a way to adjust the location of 'a val' / 'b val' more towards the centre of their title name (move leftwards)? Similarly ...
Shiva's user avatar
  • 69
1 vote
0 answers
708 views

How could I rotate in 90 degrees the legend of a plot on Matlab?

I'm creating some plots and I need to rotate in 90 degrees the legend to avoid the overlapping of the legend over the graphic. I've tried to use the 'Rotation' propriety but I receive the following ...
Timmit's user avatar
  • 11
4 votes
3 answers
210 views

Legend; text/description before key/colour?

By default MATLAB puts the text part of a legend entry after the sample of what is used in the plot. Is there any way to reverse this? For example, using the below code the first entry in the legend ...
Steve's user avatar
  • 634
3 votes
1 answer
685 views

How to add legend elements in Matlab in the plot itself

I want to somehow label vertical lines in Matlab. I could imagine two options: Either by having legend entries right next to each vertical line itself, or by having the vertical lines numbered in the ...
LenaH's user avatar
  • 323
1 vote
1 answer
842 views

How do I customize the picture in matlab legends?

I want to draw a contour plot of a plane and a surface with legends. Plotting two surfaces in the same figure create the same legends. I want to change the resulting ellipses in the legend. Can I draw ...
Marcos Vinicius's user avatar
3 votes
2 answers
11k views

How to decrease the size of the legend in a figure?

The following code plots a figure. The code should work on Matlab >= R2014b. I want to remove the space within the legend. How to do this? x = 0:0.5:10; figure; hold on; plot(x,sin(x), 'Marker', 'o');...
aban's user avatar
  • 215
2 votes
2 answers
97 views

Putting one legend for many axes

I'm using three axes-Objects to scale my data on the x-axis. My problem is that i do not know how to get a nice legend for the three plots. I have to do this cause my real data is sampled with ...
himynameis's user avatar
0 votes
0 answers
306 views

Matlab legend colors don't match lines (2)

I'm experiencing the same problem as on this thread: Matlab legend colors don't match lines However, no variation of the solution proposed seems to work on my code... My code is: thickness = ...
nimellos's user avatar
0 votes
1 answer
1k views

Latex multiline bracket in a Matlab annotation

I'm looking to annotate a figure made with Matlab with some bracket that would wrap around 3 lines. An example is given in the figure linked: I have succeeded in adding a second legend. But I'm ...
mwoua's user avatar
  • 403
0 votes
2 answers
832 views

Is it possible to separate the legend entry line into two parts in Matlab

I would like to know if it's possible to separate the line from the legend entry into two different types of lines. Example : imagine that you have 4 curves : solid black, solid red, dashed black, ...
mwoua's user avatar
  • 403
0 votes
1 answer
2k views

name of a variable in legend, matlab

I want the name of my variables in a plot legend in matlab. Is this possible? my example is: function example(x1) figure; plot(x1.time, x1.value); legend(x1); end now I want to call my ...
Kim's user avatar
  • 57
3 votes
5 answers
16k views

Matlab: change order of entries in Figure legend

I have a Figure file where I would like to change the order of the entries (e.g., put the first entry as third one). I saved this Figure.fig long time ago so I am not sure if I can recover the ...
Patapunfate's user avatar
12 votes
2 answers
21k views

How can I add a 2-column legend to a Matlab plot? [duplicate]

Consider following code: t=0:.01:(2*pi); y=[sin(t);sin(t-pi/12);sin(t-pi/6);sin(t-pi/4)]; figure(1) clf subplot(6,1,5) plot(t,y) xlim([0 2*pi]) legend('1','2','3','4') It produces ...
Karlo's user avatar
  • 1,664
1 vote
1 answer
521 views

Legend next to vertical line plot

In Matlab, it is possible to create a legend for a plot. Now I do not want the information in the legend box, but directly next to the line as follows: (This is only an example) For the vertical ...
André's user avatar
  • 257
0 votes
2 answers
565 views

Matlab legend font size doesn't update when using [l,icons,plots,txt] = legend()

I am having difficult changing the font size used in the legend of a plot in Matlab R2016a. If I use the preferred syntax l = legend() then it works correctly. However, I need access to the icons ...
Nat's user avatar
  • 615

15 30 50 per page