I have a figure with several plots and a legend. Is it possible to change the arrangement of the elements in the legend manually? For example, how could you make a two-column legend?
相关问题
- Extract matrix elements using a vector of column i
- Plotting multiple columns with ggplot2 [duplicate]
- How do you get R's null and residual deviance
- R markov chain package, is possible to set the coo
- How to display an image represented by three matri
相关文章
- How to plot smoother curves in R
- How to add clipboard support to Matplotlib figures
- Adding a legend to a matplotlib boxplot with multi
- How do I append metadata to an image in Matlab?
- How can I write-protect the Matlab language?
- `std::sin` is wrong in the last bit
- Escape sequence to display apostrophe in MATLAB
- R plot legend with transparent background
To make a two-column legend, the general consensus seems to be that you need to create two separate legends and manually place them side by side. Solution simplified from discussion here.
Of course this is possible. See an explanation here: http://undocumentedmatlab.com/blog/multi-column-grid-legend/
In 2018a, legend has a NumColumns parameter; e.g., if h is an array of handles to lines plotted, and leg_names is a cell array of names for each line:
Besides the submissions mentioned by @gnovice, there is another one on the MathWorks File Exchange which also create multi-column legends
There are two submissions on the MathWorks File Exchange which create multi-column legends for you: