**add a number to the legend MATLAB Answers - MATLAB**

I am having the data lets say for seven elements and I am ploting it using a loop in a single figure. But in these seven elements someof the elements contain nothing and then the plot for that is not plotted.... Polar plot, specified as a scalar handle. format — Format for legend label cell array Format for legend label added to the polar plot, specified as a cell array.

**add a number to the legend MATLAB Answers - MATLAB**

Here is kind of a hack which might solve your problem. It's not elegant but the trick is to plot a dummy curve in white, which won't appear on the plot but to which you can still assign a legend.... From doc for plot "If one of Yn or Xn is a matrix and the other is a vector, it [i.e., PLOT] plots the vector versus the matrix row or column with a matching dimension to the vector." OP has his Y data in an array which in Matlab must be rectangular so there cannot be 21 points in the first array but an (indeterminate) number that is a multiple of 5 (the length of X vector).

**add legend matlab plot Stack Overflow**

From doc for plot "If one of Yn or Xn is a matrix and the other is a vector, it [i.e., PLOT] plots the vector versus the matrix row or column with a matching dimension to the vector." OP has his Y data in an array which in Matlab must be rectangular so there cannot be 21 points in the first array but an (indeterminate) number that is a multiple of 5 (the length of X vector).... Polar plot, specified as a scalar handle. format — Format for legend label cell array Format for legend label added to the polar plot, specified as a cell array.

**add a number to the legend MATLAB Answers - MATLAB**

From doc for plot "If one of Yn or Xn is a matrix and the other is a vector, it [i.e., PLOT] plots the vector versus the matrix row or column with a matching dimension to the vector." OP has his Y data in an array which in Matlab must be rectangular so there cannot be 21 points in the first array but an (indeterminate) number that is a multiple of 5 (the length of X vector).... I am having the data lets say for seven elements and I am ploting it using a loop in a single figure. But in these seven elements someof the elements contain nothing and then the plot for that is not plotted.

## How To Add Legend Of Matlab Plot

### Create legend labels for polar plot MATLAB - MathWorks

- How to use legend command MATLAB Answers - MATLAB
- add legend matlab plot Stack Overflow
- add a number to the legend MATLAB Answers - MATLAB
- Add text objects to legend in MATLAB plots Stack Overflow

## How To Add Legend Of Matlab Plot

### Polar plot, specified as a scalar handle. format — Format for legend label cell array Format for legend label added to the polar plot, specified as a cell array.

- From doc for plot "If one of Yn or Xn is a matrix and the other is a vector, it [i.e., PLOT] plots the vector versus the matrix row or column with a matching dimension to the vector." OP has his Y data in an array which in Matlab must be rectangular so there cannot be 21 points in the first array but an (indeterminate) number that is a multiple of 5 (the length of X vector).
- From doc for plot "If one of Yn or Xn is a matrix and the other is a vector, it [i.e., PLOT] plots the vector versus the matrix row or column with a matching dimension to the vector." OP has his Y data in an array which in Matlab must be rectangular so there cannot be 21 points in the first array but an (indeterminate) number that is a multiple of 5 (the length of X vector).
- I am having the data lets say for seven elements and I am ploting it using a loop in a single figure. But in these seven elements someof the elements contain nothing and then the plot for that is not plotted.
- I have a matlab function myfunction(var1,var2) which gives me a plot with a legend. I would like to generate more plots with this function in one graph.

### You can find us here:

- Australian Capital Territory: Macgregor ACT, Farrer ACT, Banks ACT, Curtin ACT, Throsby ACT, ACT Australia 2639
- New South Wales: Monaltrie NSW, Foxground NSW, Anambah NSW, East Hills NSW, Tabbita NSW, NSW Australia 2042
- Northern Territory: Ilparpa NT, Katherine South NT, Adelaide River NT, Warruwi NT, Minjilang NT, White Gums NT, NT Australia 0813
- Queensland: Tugun QLD, Underwood QLD, Bentley Park QLD, Springfield QLD, QLD Australia 4079
- South Australia: Hardwicke Bay SA, Simmonston SA, Inverbrackie SA, Joslin SA, Hookina SA, Nora Creina SA, SA Australia 5067
- Tasmania: Exeter TAS, Ranelagh TAS, Ross TAS, TAS Australia 7068
- Victoria: Bullioh VIC, Melbourne St Kilda Rd VIC, Underbool VIC, Pootilla VIC, Delahey VIC, VIC Australia 3006
- Western Australia: Aubin Grove WA, Londonderry WA, Yorkrakine WA, WA Australia 6079
- British Columbia: Canal Flats BC, Burnaby BC, Nakusp BC, Harrison Hot Springs BC, Canal Flats BC, BC Canada, V8W 6W2
- Yukon: Gordon Landing YT, De Wette YT, Klukshu YT, Quill Creek YT, Readford YT, YT Canada, Y1A 6C3
- Alberta: Bawlf AB, Valleyview AB, Botha AB, Provost AB, Breton AB, Youngstown AB, AB Canada, T5K 1J3
- Northwest Territories: Colville Lake NT, Ulukhaktok NT, Tsiigehtchic NT, Whati NT, NT Canada, X1A 4L1
- Saskatchewan: Nipawin SK, Tisdale SK, Ernfold SK, Goodwater SK, Osage SK, Esterhazy SK, SK Canada, S4P 2C7
- Manitoba: Churchill MB, Flin Flon MB, Neepawa MB, MB Canada, R3B 4P2
- Quebec: Saint-Lazare QC, Saint-Jerome QC, Sorel-Tracy QC, Brossard QC, Val-David QC, QC Canada, H2Y 9W6
- New Brunswick: Saint-Hilaire NB, Saint-Quentin NB, Nackawic NB, NB Canada, E3B 8H5
- Nova Scotia: Liverpool NS, Clark's Harbour NS, Kentville NS, NS Canada, B3J 8S3
- Prince Edward Island: Breadalbane PE, Union Road PE, North Shore PE, PE Canada, C1A 8N6
- Newfoundland and Labrador: Terrenceville NL, Come By Chance NL, Rose Blanche-Harbour le Cou NL, Norris Point NL, NL Canada, A1B 5J3
- Ontario: Hawkestone ON, Hilliard ON, Trenton ON, Mount Pleasant, Hastings County, Happy Hollow ON, Dalston ON, McMurrich/Monteith ON, ON Canada, M7A 1L2
- Nunavut: Frobisher Bay (Iqaluit) NU, Chesterfield Inlet NU, NU Canada, X0A 7H6

- England: Southampton ENG, Cannock ENG, Redditch ENG, Stevenage ENG, Chelmsford ENG, ENG United Kingdom W1U 3A2
- Northern Ireland: Newtownabbey NIR, Newtownabbey NIR, Newtownabbey NIR, Newtownabbey NIR, Bangor NIR, NIR United Kingdom BT2 2H9
- Scotland: Kirkcaldy SCO, Cumbernauld SCO, Paisley SCO, Dunfermline SCO, East Kilbride SCO, SCO United Kingdom EH10 3B9
- Wales: Newport WAL, Newport WAL, Neath WAL, Swansea WAL, Swansea WAL, WAL United Kingdom CF24 7D5