MATLAB: Plot3 error bars error barplot3 Hi all, does anyone know how I might add an error bar to a data point along the Z axis for a plot3 plot? Best Answer The errorbar function is only defined for 2D plots. Here’s one approach to plotting errorbars with plot3: x = rand(10,1); % Create Datay = rand(10,1); % Create Dataz = rand(10,1); % Create Dataerrl = rand(10,1)/5; % Error Bar Low Limitserrh = rand(10,1)/5; % Error Bar High Limitsfigureplot3(x(:)', y(:)', z(:)') % Plot Datahold onplot3([x(:),x(:)]', [y(:),y(:)]', [-errl(:),errh(:)]'+z(:)', '-r') % Plot Error Barshold offgrid onlegend('Data','Errors')These error bars don’t have crossbars at the ends, and it’s not immediately obvious to me how to add them. Plotting a dot marker at the ends is one option, using '.-r' (instead of '-r') as the LineStyle. Related SolutionsMATLAB: 4-D plot in Matlab For vectors v1, v2, v3, and v4, you can plot the first three vectors as x,y,z locations and v4 as color withscatter3(v1,v2,v3,30,v4,'filled')The 30 scales the marker size. MATLAB: Plot & errorbar: does exist a function that plot many series of data with error bars The simplest way is probablyplot(X1,Y1);errorbar(X1,Y1,errors1);plot(X2,Y2);errorbar(X2,Y2,errors2);...plot(Xn,Yn);errorbar(Xn,Yn,errorsn); Related QuestionStandard deviation error bars not in the centre of the barHow to plot an alphaShape to a specific axes in app designerHow to show errorbar only for few selected dataLegend doesn’t match plot
Best Answer