MATLAB: Adding legend to geoglobe with several geoplot3 lines

geoglobegeoplot3legendMATLAB

How can I add a legend to a geoglobe with several geoplot3 lines?

Best Answer

Hey Julian,
MATLAB at present does not support adding legends to geoglobe. I noticed that this request was already brought to the attention of the concerned parties. They may investigate the matter further.
Presently, as a workaround, consider using the uigridlayout function to create a separate grid, where one grid can be used to display the geoglobe plots and the other grid for displaying the text and legends. In the second grid, you could use the uiaxes function to create an axes and title for the contours and legend. Further, you could use the legend function to create the legends for the geoplots & the drawnow function to ensure that the legend is drawn with the desired colors.
Hope this helps!