All Questions
Tagged with legend matlab-figure
86
questions
8
votes
3
answers
13k
views
Dynamic Legend (Updates in every recursion)
I got a for i=1:15. Inside I generate a variable d=1:0.01:10, which is the x'x axis and based on this, I create a continuous function F(d) which has 2 unique variables pitch and yaw. I then plot this ...
2
votes
1
answer
13k
views
Compress the size or reduce the line spacing of a legend in matlab figures
I'm trying to make a legend in a matlab figure that takes less space, in particular vertical size. Ideally, if I could change the inter-line spacing of the legend, this would have solved it, but I can'...
2
votes
1
answer
761
views
matlab, symbol not updating in legend
I am creating a program where the user can select multiple files to plot and compare data. The program can properly graph the data, the problem I have encountered is within the legend.
I tried ...
5
votes
1
answer
2k
views
Fix position of legend in MATLAB
How do I fix the position of a legend in a MATLAB figure?
I'm currently building a GUI, intended for public use, and when figures inside the GUI are produced I do not want the user to be able to move ...
3
votes
1
answer
283
views
modifications in legend are not saved by using saveas
I just got some strange behaviour when saving a figure by using saveas. You should be able to reproduce this with this:
%just plot a line:
plot(1:10);
legend('line 1')
%find the line (not the best ...
1
vote
1
answer
614
views
Plotting multiple graphs with different colour on matlab
I want to draw two graphs in Matlab with different colors. Then I want a box in the upper right corner which names each of the two graphs. The code that I am writing is:
x=1:1:max
%err_t_coupled,...
3
votes
2
answers
6k
views
Matlab: Reduce the spacing between symbols and labels in the legend
When using the legend command in matlab, how can I reduce the horizontal distance between the legend symbols and their corresponding labels?
Example code:
Line1=plot(x1,y1,'s');
Line2=plot(x2,y2,'o'...
1
vote
1
answer
669
views
How to add selective datasets for legends
I have a plot in which 15 datasets are plotted along with their trendlines(lslines). If i use the command legend, it displays all the datasets and lslines, totally 30 legends. But i want to ignre ...
2
votes
1
answer
4k
views
legend for selected plot objects in MATLAB figure
For a MATLAB figure, I have something like:
figure; hold on;
line ( [1 2], [3 4] );
line ( [5 6], [7 8] );
plot(x1,y1,'r.');
plot(x2,y2,'b.');
where x1,y1,x2,y2 are all vectors.
How can I add ...
9
votes
4
answers
49k
views
How do I add two legends to a single plot in MATLAB?
I'd like to add two legends to a plot in MATLAB. How can I do this?
0
votes
1
answer
2k
views
MATLAB - Add legend next to some chosen plots in a subplot - for loop
I want to add legends in a subplot, bu only for certain plots.
Here is my code :
for j = 1:length(FL)
for i = 1:length(index_list)
pos=pos+1;
subplot(size(FL,1),length(index_list), pos)
...