How can I change Center Line, LCL, and UCL linestyles in controlchart for xbar and R charts.

9 次查看(过去 30 天)
I want to modify Shewhart Xbar and R control chart formats to work in greyscale. How can I change the line styles and colors for the Center Line, LCL, and UCL? I need them to be accessible for color blind users and cheap to print. (I'm a self taught Matlab beginner trying to teach it to undergrads...I am not trying to get you to do my homework for me.)
stats = controlchart(WeightsRevisedRows1_21_23_25,ChartType=["xbar","r"])

回答(1 个)

Mathieu NOE
Mathieu NOE about 19 hours 前
hello Peggy
maybe try this
% Example: Create a control chart
data = randn(30,4); % Example data
controlchart(data);
% Access the chart's graphical elements
chart = gca; % Get current axes
lines = chart.Children % Access chart elements (lines, markers, etc.)
lines =
4×1 Line array: Line (lclucl) Line (cl) Line (ooc) Line (pts)
% Change the color of specific elements
Lightgray =[0.8, 0.8, 0.8];
Mediumgray = [0.5, 0.5, 0.5];
Darkgray = [0.2, 0.2, 0.2];
Black = [0, 0, 0];
lines(1).Color = Darkgray; % Change the first line to Dark gray
lines(2).Color = Lightgray; % Change the second line to Light gray
lines(3).Color = Mediumgray; % Change the second line to Medium gray
lines(4).Color = Black; % Change the second line to black

类别

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

产品


版本

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by