How do I color my orbits based off of Jacobi Constant?
1 次查看(过去 30 天)
显示 更早的评论
This is what I want my plot to look like:
This is what my plot looks like:
This is my plot code with Jacobi Constant vector:
figure(1), color_map = jet(15);
grid on, hold on,
for ii = 1:15
plot(x(:, 1), x(:, 2), 'Color', color_map(ii, :), 'Linewidth', 1),
xlabel('x, NDU'), ylabel('y, NDU'),
plot(L(1, 1), 0, 'k.', 'MarkerSize', 20),
text(L(1, 1) + 0.013, 0, 'L1', 'Color', 'k'),
plot(L(2, 1), 0, 'k.', 'MarkerSize', 20),
text(L(2, 1) + 0.013, 0, 'L2', 'Color', 'k'),
plot(L(3, 1), 0, 'k.', 'MarkerSize', 20),
text(L(3, 1) + 0.005062645806268, 0, 'L3', 'Color', 'k'),
plot(L(4, 1), L(4, 2), 'k', 'Markersize', 20),
text(L(4, 1) - 0.05, L(4, 2) + 0.05, 'L_4', 'Color', 'k'),
plot(L(5, 1), L(5, 2), 'k', 'Markersize', 20),
text(L(5, 1) - 0.05, L(5, 2) - 0.05, 'L_5', 'Color', 'k'),
plot(1 - mu, 0, 'k.', 'MarkerSize', 20),
text(1 - mu + 0.013, 0, 'Moon', 'Color', 'k'),
plot(-mu, 0, 'k.', 'MarkerSize', 20),
text(-mu + 0.02, 0, 'Earth', 'Color', 'k'),
end
colorbar
C =
3.007676099413564
2.994200622706611
2.971545695246074
2.939417270410701
2.897381208873815
2.844828980359512
2.780923329169862
2.704511298825675
2.613980216377739
2.507005968545220
2.380077662128345
2.227495703195107
2.038881730418720
1.791003662001313
1.396075232221978
My central problem is that the Jacobi Constant values are not integers and I am not sure how to associate each value with a color to plot. This code has many support functions and I did not add them here. Hopefully this is enough to answer the question.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!