作者chungyuandye (養花種魚數月亮賞星星)
看板Mathematica
標題Re: [問題] 圖上兩條曲線如何加註
時間Tue Oct 4 21:17:39 2011
※ 引述《tsungjen ()》之銘言:
: 在一張有兩條方程式曲線的圖上面
: 我想要像在excel上一樣,加註哪一條顏色代表哪一條方程式
: 但是我找不到方法
: 書上,help,跟網路資源都沒有提到
: 是不是mathematica沒有提供這項功能阿?
: 那這樣我要找別的繪圖軟體了QQ
Needs["PlotLegends`"]
Plot[{fun1, fun2]}, {x, range},
PlotLegend -> {"name 1", "name 2"},
LegendPosition -> {位置}, LegendSize -> {大小},
LegendShadow -> None, LegendBorder -> {Black}]
example
Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, PlotLegend -> {"sine", "cosine"},
LegendPosition -> {0, 0}, LegendSize -> {1, 0.5},
LegendShadow -> None, LegendBorder -> {Black}]
如果加圖例只是要自己判斷函數位置的話,那比較簡單的方法應該是Tooltip
Plot[{Tooltip[Sin[x], "Sine Sine Sine Sine"],
Tooltip[Cos[x], "Cosine Cosine Cosine Cosine"]}, {x, 0, 2 Pi}]
記得把滑鼠游標到函數上
--
養花種魚數月亮賞星星
http://chungyuandye.twbbs.org
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.173.129.64
推 kichigop:借問:Legend內的字體大小可以調整嗎? 10/20 09:40
推 kichigop:自問自答, 把"text"換成StyleForm["text",FontSize->20] 10/20 09:55