How can i change the boarder color of CIE1931 plot? I want to change the chromaticity plot boarder color to black
Show older comments
figure(1);
plotChromaticity();
hold on;
clc
clear all
cd('C:\Users\RABIUL ISLAM\Desktop');
raj = xlsread("cie variation due to polarization angles.xlsx");
cie_x = raj(:,4);
cie_y = raj(:,5);
% Plot the white connecting line
plot(cie_x, cie_y, 'w-', 'LineWidth', 2);
% Scatter plot using pentagram (5-pointed star)
h = scatter(cie_x, cie_y, 100, 'k', 'p', 'filled');
here is my code...I want to change the boarder colour of CIE1931 chromaticity plot to black...How can i do it?
Answers (1)
figure(1);
plotChromaticity();
hold on;
To make the axes border black all around:
box on
Or, if you mean to make the surface edges black:
p = findall(gca(),'Type','surface');
p.EdgeColor = 'k';
The rest of the code with random data to show both effects:
cie_x = rand(10,1);
cie_y = rand(10,1);
% Plot the white connecting line
plot(cie_x, cie_y, 'w-', 'LineWidth', 2);
% Scatter plot using pentagram (5-pointed star)
h = scatter(cie_x, cie_y, 100, 'k', 'p', 'filled');
2 Comments
MD. Rabiul
on 22 Mar 2025
Here are a couple of attempts at that. Maybe the second one is good enough for this specific case.
figure();
plotChromaticity();
hold on;
p = findall(gca(),'Type','surface');
k = boundary(p.XData(:),p.YData(:));
plot(p.XData(k),p.YData(k),'k','LineWidth',2)
figure();
plotChromaticity();
hold on;
p = findall(gca(),'Type','surface');
k = convhull(p.XData(:),p.YData(:));
plot(p.XData(k),p.YData(k),'k','LineWidth',2)
Categories
Find more on Line 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!


