Skip to main content

All Questions

Tagged with
0 votes
0 answers
37 views

Create two rows legend in Malab simulation [duplicate]

I would like to create 2 rows of legend in Matlab. I would like to draw 2 rows, each row has 8 lines from e(11,k) to e(44,k) After some reading, I still be stuck on this, Could you help me figure out ...
Chuong Nguyen's user avatar
2 votes
2 answers
893 views

Matlab: How to set color of legend in a scatter plot where each data point gets a different color?

Here is the sample code: x = rand(100,1); y = rand(100,1); score = rand(100,1); figure; colormap(flipud(bone)); caxis([0 1]) axis([0 1 0 1]) scatter(x,y,50,score,'+','LineWidth',2); legend('scores'); ...
ChubbyRuby's user avatar
1 vote
1 answer
928 views

MATLAB Plot - Legend entry for multiple data rows - getcolumn

Consider the following example: x = magic(3); figure(1); clf(1); plot( x, '-r', 'DisplayName', 'Magic' ); legend( 'show' ); The resulting legend entries in MATLAB R2014a are getcolumn(Magic,1) ...
Discbrake's user avatar
  • 315
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
9 votes
2 answers
1k views

Why is Matlab placing text spaces in legend using Latex when the figure gets saved as a PDF?

I am trying to put a legend in Matlab figures that include a symbol in Latex. When I plot the figure, the legend looks fine. However, when I export the figure as a PDF, the legend gets spaces put into ...
Lou's user avatar
  • 1,143
1 vote
1 answer
467 views

How to place a colorbar in Matlab plot legend Icon

I visualize map overlays in Matlab with some surfaces with RGB texture. It looks like this: I would like to have better Legend icons that make clear which layer is which. Something like this: While ...
Laurenz's user avatar
  • 1,890
0 votes
1 answer
562 views

Legend in bar3 in MATLAB

I can't figure out how to create the legends (for colors) in the attached code? test1=[5 10 7; 1 100 0; 1 3 2]; test2=[10 15 10; 10 80 10; 5 5 15]; test3=[10 10 10; 20 200 20; ...
Reza 's user avatar
  • 11
3 votes
1 answer
742 views

How to add legend in a highlighted graph?

I want to add legend in a graph G according to different highlighted edges. Is it possible to do it with only one graph G? Here is a toy example to play with. I have a plot G. adj =[0 0 1 1 1; % ...
Yolanda Wang's user avatar
2 votes
1 answer
2k views

Choosing specific line to legend in different matlab runs

I have made a simulation that calculates trajectories of objects and plot it. The figure looks like this: figure(1) plot(ArrayRT1,ArrayRT2); hold on plot(ArrayRD1,ArrayRD2); plot(ArrayRM1,ArrayRM2); ...
Ben's user avatar
  • 1,829
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
498 views

Matlab: Long, multiline, Legends with latex interpreters

I have several lines in a figure, each of them having their own legend entries. One of the legend entries is quite long, and I need it to split up into lines. Further, since I have some symbols coming ...
AaKa's user avatar
  • 1
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
833 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
237 views

How to force legend entries as power of 10 in MATLAB

This is an extension of How to change display format of legend in MATLAB. I am looking for a way to force the legend entries in a particular format. In following code, they are displayed like ...
NAASI's user avatar
  • 173
3 votes
1 answer
717 views

How to change display format of legend in MATLAB

I am looking for a way to force the legend entries in a particular format. I following code, they are displayed like Instead I want it like 1e-1,1e-2,1e-3,1e-4, 1e-5. Is there a way to do this. ...
NAASI's user avatar
  • 173

15 30 50 per page