MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   我们如何在金融烛台图上绘制红点(代表交易)? (https://www.labfans.com/bbs/showthread.php?t=23264)

poster 2019-12-10 20:30

我们如何在金融烛台图上绘制红点(代表交易)?
 
我正在使用此MATLAB函数绘制金融烛台图:

[URL]http://www.mathworks.com/help/toolbox/finance/candlefts.html[/URL]

我如何在图表上绘制一个红点以表示当时的交易?



[B]回答:[/B]

对于要添加的点,您需要将其在y轴yValue上的位置以及将其放置在x轴xValue上的[URL="http://www.mathworks.com/help/techdoc/ref/datenum.html"]日期[/URL] (格式为单个[URL="http://www.mathworks.com/help/techdoc/ref/datenum.html"]序列号[/URL] )。然后,以下应该工作:

candle(...); %# Make your candle plot hold on; %# Add to the existing plot plot(xValue,yValue,'r.'); %# Plot a red dot 如果您想要更大的红点,则可以用以下任一替换最后一行:

plot(xValue,yValue,'r.','MarkerSize',20); plot(xValue,yValue,'ro','MarkerFaceColor','r');

[url=https://stackoverflow.com/questions/2561707]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 04:57

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.