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
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
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
2 votes
1 answer
418 views

Matlab legend does not match plot

I used the following code to generate my plot (and I want it later to include in my LateX document): clear all; close all; clc; a1 = 1; a2 = 1; c1 = 2.0; c2 = 1.8; time = 0:0.1:300; wave1 = a1 * sin(...
André's user avatar
  • 257
0 votes
1 answer
381 views

Legend from two different plots on one single plot

So if I run my code I am supposed to get a legend for both the plots but I am getting only for one. Can someone please give a solution. I want both plots in one graph but the separate legend command ...
Chris Toomer's user avatar
0 votes
2 answers
2k views

Legend Location 'Best', but still in corner if possible

I want to set the Location of my legend to 'Best' (like legend('y1','y2','Location','Best')) so the legend doesn't collide with my lines, but at the same time, I would prefer to have it in a corner if ...
Max's user avatar
  • 1,481

15 30 50 per page