All Questions
Tagged with legend matlab-figure
86
questions
2
votes
1
answer
366
views
Matlab: wind rose plot: change legend
I want to plot a wind rose but my data for the wind speed is very low (0-20). I found the WindRose package here (https://se.mathworks.com/matlabcentral/fileexchange/47248-wind-rose) and it gives me ...
1
vote
0
answers
709
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 ...
3
votes
2
answers
8k
views
matlab : suppress legend entry without removing from Plot Browser
One can suppress a legend entry for a line object h by executing h.HandleVisibility='off' or h.Annotation.LegendInformation.IconDisplayStyle='off'. However, both actions also prevent the curve from ...
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 ...
0
votes
1
answer
473
views
Matlab: Replicate legend location's 'outside' scaling behavior
The preceding figure was produced by the following code:
hold on;
plot([1,2,3,4],[1,2,3,4]);
plot([1,2,3,4],[4,3,2,1]);
legend('foo', 'bar', 'location', 'eastoutside');
Re-scaling the width of the ...
4
votes
2
answers
629
views
Matlab; Pie chart with 2+ / split legends R2017b
I'm creating a pie chart and ideally want the legend to be displayed horizontally at the top and/or bottom. However, in almost all cases this isn't possible as the legend go off the figure. Therefore, ...
1
vote
1
answer
158
views
Display surplus legend entries for gscatter plot
how can i display surplus legend entries, that don't have a corresponding group in a gscatter plot?
I.E. display the "Six" in following code:
len = 100;
x = zeros(len, 1);
groups = randi(5, len, 1);
...
0
votes
1
answer
114
views
Legend entries out of box
I am using semilogx to plot data. Whenever I save the generated graph as an eps or a pdf file, legend entries go out the legend box (see the attachment). However, for .jpg it works fine. Please advise....
0
votes
0
answers
71
views
Legend displayed wrongly, one entry is out of the box, one is inside
I just wanted to add a very simple legend to my plots. But every time I want to add a legend, it displays it as can be seen in the picture:
One entry has a very long line and the second entry is on ...
1
vote
1
answer
81
views
How to input legend in figure with one variable?
I have a variable x, whose value is
x=0:3:30;
I want to input a legend as
My code is like
x = 0:3:30;
figure(1); hold on; grid on;
for i=1:length(Var)
plot(f1(val(x)));
end
legend('input 0', '...
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');...
0
votes
1
answer
229
views
Group plots with error-bars
I have the following code that makes a plot:
dfs = [0 5 10 15 20 25 ];
Intensities = [0.0593 0.0910 0.1115 0.0611 0.0975 0.0715] ;
SE = [0.2165 0.2068 0.2555 0.2479 0.2340 0.2239];
errorbar(dfs, ...
1
vote
3
answers
643
views
Creating a legend in MATLAB that includes scatter plots and normal plots
I want my legend to include the line from the plot and the marker from the scatterplot. For example,
rest = importdata('test.xlsx');
x = test.data(:,1);
y = test.data(:,2);
xx = min(x):0.001:max(x);...
2
votes
2
answers
73
views
Move line in legend
I have a cell array with four strings which is used as legend for four individual X,Y plots. One string is very long and therefore divided into a four-line legend by sprintf, The four plot legend is ...
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 ...