legend repeating same color only after errorbar

2 次查看(过去 30 天)
i have a figure that shows 6 diffrent values.
3 lines and 3 errorbars, when i use legend the color stuck after the errorbar.
if i change the order the color stays the same only for 5 times and dor the 6 is normal.
the code for this graph is included.
i think the problem is with the errorbar, the function somehow gives the point individual and not togeter.
  1 个评论
Josef
Josef 2023-8-27
I found the problem.
I gave the function "errorbar" a singal value for the y-error and a array of 5 values for the x-error, you must use the same length of array for them to count as a "singal line".

请先登录,再进行评论。

采纳的回答

Voss
Voss 2023-8-27
编辑:Voss 2023-8-27
Each call to errorbar() creates multiple errorbar objects in this case. To use only one of each color in the legend, store their handles and specify in the call to legend() that only the first element of each shall be used. See the code attached.
Flow_meas_graph12

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Errorbars 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by