Skip to main content

All Questions

1 vote
1 answer
58 views

How to make Matlab legend show opaque plot symbols when scatter plot symbols are semi-transparent in the figure

I am trying to create a scatter plot cloud, of which I set the points are all "filled" and semi-transparent by setting "MarkerFaceAlpha=0.1". However, when I export the legend ...
Kevin's user avatar
  • 29
2 votes
1 answer
99 views

How to change the legend string for different subplots?

I would like to add a legend to every subplot as shown below each legend is theta_(1/2)=5, theta_(1/2)= 10, theta_(1/2)=15,...,theta_(1/2)=60. How can I change the number for each legend? Q = [16,32,...
SH_IQ's user avatar
  • 655
0 votes
1 answer
360 views

How to make two markers share same label in Matlab plots

I am building a MATLAB script to add two markers for a single label similar to below in Python. How to create two legend objects for a single plot instance? and Sharing the same label for two plots ...
techenthu's user avatar
  • 158
1 vote
2 answers
588 views

Is there a way to update the legend as the for goes on?

I've been thinking how I could update in Matlab the legend of my plots as the for goes on, basically, I have a for which creates a graph that is added to the plot (using hold on) in every iteration, I'...
Luca Dordoni's user avatar
0 votes
1 answer
901 views

More line styles in Matlab - without markers?

Is there some way to plot more than 4 line styles in Matlab (as it is stated here https://www.mathworks.com/help/matlab/creating_plots/specify-line-and-marker-appearance-in-plots.html), I mean line ...
nick_name's user avatar
  • 161
1 vote
0 answers
181 views

Change LineWidth of marker in MatLab

I would like to change the linewidth of the marker independent from the linewidth of the plotted solid line. By now (see code) I am able to change it in the plot itself. The legend however is a ...
WM_noob5's user avatar
3 votes
1 answer
98 views

How can I automatically display a legend so that it touches the border of a corner in a Matlab (R 2019b) plot?

I know how to use the 'Location' input of the legend function, but none of the options put the legend right in the corner, they all leave a small space between the legend and the border of the plots. ...
Max's user avatar
  • 33
2 votes
1 answer
539 views

How to prevent the legend from updating in R2017a and newer?

Since MATLAB R2017a, figure legends update automatically when adding a plot to axes. Previously, one could do this: data = randn(100,4); plot(data) legend('line1','line2','line3','line4') hold on ...
Cris Luengo's user avatar
  • 59.4k
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 ...
brtstph's user avatar
  • 33
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 ...
user001's user avatar
  • 1,848
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
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, ...
Pugl's user avatar
  • 452
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);...
brad's user avatar
  • 89
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
1 vote
3 answers
340 views

Making a legend when some of the data sets could be empty

For my project I have six sets of data to put on a scatter plot, like so: plot(ax, ay, '.r', bx, by, '.b', cx, cy, '.m', dx, dy, '.c', ex, ey, '.y', fx, fy, '.k'); Sometimes these sets of data will ...
Rosie's user avatar
  • 27

15 30 50 per page