1
我想創建R的幹情節我有一個MATLAB代碼,但不知道如何寫在R相同的代碼的MATLAB代碼如下如何在R中創建乾圖?
x = 0:25;
y = [exp(-.07*x).*cos(x);exp(.05*x).*cos(x)]';
h = stem(x,y);
set(h(1),'MarkerFaceColor','blue')
set(h(2),'MarkerFaceColor','red','Marker','square')
h(1) is the handle to the stemseries object plotting the expression exp(-.07*x).*cos(x).
h(2) is the handle to the stemseries object plotting the expression exp(.05*x).*cos(x).
你用Google搜索? https://www.r-bloggers.com/matlab-style-stem-plot-with-r/ – MichaelChirico
堆棧溢出不是代碼翻譯服務。您應該將數據包含在[可重現的R格式](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)中,並更精確地描述所需輸出(鏈接以示例圖片將是有益的)。 – MrFlick
是的,我做了Google搜索,我看到了代碼。但是,我有兩個組(A和B),我想繪製一段時間內的鉛水平(y軸)(x軸 - 例如0,1,2,3) – browndynamite