how i can change my color of picture i want yellow one?

조회 수: 3 (최근 30일)
salim
salim 2024년 10월 25일
편집: Piyush Kumar 2024년 10월 26일
How i get this one can any one give me some idea or if have example form it will be so good ?
I already have this but i want other type of plot like above or even better if exist

답변 (1개)

Piyush Kumar
Piyush Kumar 2024년 10월 26일
편집: Piyush Kumar 2024년 10월 26일
To plot a figure you have shared, you would need the function that is plotted. There is an inset plot in the figure too.
You can follow these steps -
  • Collect the x,y,z points
  • Use the surf function to create the 3D plot
  • Set colormap
  • Use "hold on" to add inset plot in the same figure
  • Add labels for the plot
  • Create inset plot
  • Set axis limit and aspect ratio
Suppose you want to plot ,
% Define x,y,z points
[x, y] = meshgrid(linspace(-20, 20, 100), linspace(-20, 20, 100));
z = sin(sqrt(x.^2 + y.^2)) ./ sqrt(x.^2 + y.^2);
% Create the 3D surface plot
figure;
surf(x, y, z, 'EdgeColor', 'none');
colormap(jet);
hold on;
% Add a plane
planeZ = zeros(size(x));
surf(x, y, planeZ, 'FaceColor', 'yellow', 'EdgeColor', 'none', 'FaceAlpha', 0.5);
% Set labels
xlabel('x');
ylabel('y');
zlabel('u(x,y)');
% Create inset plot
axes('Position', [0.7, 0.7, 0.2, 0.2]);
plot(x(1, :), z(50, :), 'k', 'LineWidth', 1.5);
xlabel('x');
ylabel('u(x)');
title('Inset');
% Adjust view
view(3);
axis tight;

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by