gpt4 book ai didi

octave - 如何为散点函数中的每个值分配颜色 - GNU Octave

转载 作者:行者123 更新时间:2023-12-01 14:09:36 27 4
gpt4 key购买 nike

如何使用 GNU Octave 中的 scatter 函数为每个绘制值分配颜色?

最佳答案

这是一个很好的说明性示例:

X = linspace(0, 4 * pi, 100);                       % Create points (100 elements)
Y = 100 * sin(X);

S = Y + 100; % Sizes array. All values need
% to be larger than 0

C = [linspace(0,1,100); ones(1,100); ones(1,100)]'; % create hsv triplets at full
% saturation and value that
% cover the whole colour
% (i.e. hues) spectrum

C = hsv2rgb(C); % convert to rgb triplets; to
% be used as a 'colour array'

scatter(X,Y,S,C,'filled','MarkerEdgeColor','k'); % fill bubbles, black border

enter image description here

关于octave - 如何为散点函数中的每个值分配颜色 - GNU Octave,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38550379/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com