Skip to main content

All Questions

Tagged with
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 ...
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'...
3 votes
0 answers
97 views

In a quiver plot with ShowArrowHead = 'off', how do I keep the arrowhead from displaying in the legend as well?

When plotting with quiver() and setting the 'ShowArrowHead' property to 'off', the arrowheads aren't shown in the plot (as expected). However, the legend entry still shows an arrowhead. I would expect ...
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,...
3 votes
1 answer
533 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 ...
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 ...
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'...
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 ...
2 votes
3 answers
373 views

How to customize a legend in matlab plot window

As shown in the image below, the legend is too long for the plot window. what I want to do is: 1- To know how to split the legend over a second line? 2- To know how to shorten the red line in ...
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 ...
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 ...
0 votes
1 answer
100 views

Change color graphic bar

I have two datasets of data printed on the same graph. What I want is to differentiate the information by putting a legend that indicates the color of each of the two pieces of information in the ...
0 votes
1 answer
253 views

How to distinguish multiple overlapping lines on MATLAB graphs?

How can I distinguish multiple overlapping lines on MATLAB graphs like this?
-2 votes
1 answer
1k views

How to add plot labels loops in matlab [duplicate]

I have data that I am plotting using a for loop. I dont know how to add a label for each graph to form a legend. This data is a lot and the names will have to be added in a looped manner. Please ...
2 votes
1 answer
71 views

MATLAB R2019a won't show legend of primitive lines

I have recently changed to a newet version of Matlab (R2019) and when I try to add a legend on my graph I get the following error: '' Inputs must be the same size or either one can be a scalar.'' The ...

15 30 50 per page
1
2 3 4 5 6