How to have different line styles and markers in one plot?
1 view (last 30 days)
Show older comments
This is my code. For now, it is only o- for all six configurations. i want each to have different markers and line styles.
% Define alpha values
alpha_values = [0, 0.25, 0.5, 0.75, 1];
% Define gamma values for each alpha
gamma_values = [
1, 0.943, 0.577, 0.941, 0.851, 0.988; % Alpha = 0
0.971, 0.9146, 0.6267, 0.9, 0.886, 0.977; % Alpha = 0.25
0.941, 0.8958, 0.6778, 0.8593, 0.9233, 0.9676; % Alpha = 0.5
0.912, 0.87, 0.728, 0.818, 0.958 0.9575; % Alpha = 0.75
0.8826, 0.848, 0.7786, 0.777, 0.9959,0.947; % Alpha = 1
];
% Define gamma values for each alpha
gamma_values_kron = [
0.811, 0.75, 0.929, 0.929, 0.75, 1; % Alpha = 0
0.838, 0.808, 0.941, 0.927, 0.759, 0.988; % Alpha = 0.25
0.865, 0.864, 0.951, 0.928, 0.771, 0.977; % Alpha = 0.5
0.896, 0.927, 0.968, 0.926, 0.780 0.965; % Alpha = 0.75
0.926, 0.987, 0.981, 0.926, 0.791,0.954; % Alpha = 1
];
% Plot the values
figure;
plot(alpha_values, gamma_values, 'o-', 'LineWidth', 1.5);
xlabel('\alpha','FontSize', 16, 'FontWeight', 'bold');
ylabel('\gamma','FontSize', 16, 'FontWeight', 'bold');
set(gca, 'FontSize', 12, 'FontWeight', 'bold');
title('\alpha vs. \gamma','FontSize', 16, 'FontWeight', 'bold');
legend('Gold-Chaotic', 'Kasami-Chaotic', 'Gold-Kasami', 'Barker-Gold', 'Barker-Chaotic', 'Barker-Kasami', 'Location', 'Best');
grid on;
0 Comments
Accepted Answer
Voss
on 7 May 2024
Edited: Voss
on 7 May 2024
% Define alpha values
alpha_values = [0, 0.25, 0.5, 0.75, 1];
% Define gamma values for each alpha
gamma_values = [
1, 0.943, 0.577, 0.941, 0.851, 0.988; % Alpha = 0
0.971, 0.9146, 0.6267, 0.9, 0.886, 0.977; % Alpha = 0.25
0.941, 0.8958, 0.6778, 0.8593, 0.9233, 0.9676; % Alpha = 0.5
0.912, 0.87, 0.728, 0.818, 0.958 0.9575; % Alpha = 0.75
0.8826, 0.848, 0.7786, 0.777, 0.9959,0.947; % Alpha = 1
];
% Plot the values
figure;
hold on
markers = 'os^><v';
styles = {'-','--','-.',':','-','--'};
for ii = 1:size(gamma_values,2)
plot(alpha_values, gamma_values(:,ii),[markers(ii) styles{ii}],'LineWidth',1.5);
end
xlabel('\alpha','FontSize', 16, 'FontWeight', 'bold');
ylabel('\gamma','FontSize', 16, 'FontWeight', 'bold');
set(gca, 'FontSize', 12, 'FontWeight', 'bold');
title('\alpha vs. \gamma','FontSize', 16, 'FontWeight', 'bold');
legend('Gold-Chaotic', 'Kasami-Chaotic', 'Gold-Kasami', 'Barker-Gold', 'Barker-Chaotic', 'Barker-Kasami', 'Location', 'Best');
grid on;
0 Comments
More Answers (0)
See Also
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!