关于画图的图例Legend
mathematica吧
全部回复
仅看楼主
level 1
各位,想请问下误差棒的图例能通过MMA自带函数调出来吗,还是说要先通过自己画呢,抑或不大用到?
我从自带帮助里找到
Needs["ErrorBarPlots`"]
ErrorListPlot[{{{1, 1}, ErrorBar[0.2, 0.3]}, {{2, 2},
ErrorBar[{-0.5, 1.5}]}, {{3, 4}, ErrorBar[0.3]}, {{4, 6},
ErrorBar[0.4]}, {{5, 7}, ErrorBar[0.8]}, {{6, 10},
ErrorBar[0.5, 1.2]}}, AxesOrigin -> {0, 0}]
难道说我留下一个来跟其他的用Show之类的拼接吗[汗]
2018年12月11日 12点12分 1
吧务
level 15
……我能说我没看明白你的意思吗?
2019年01月05日 09点01分 2
level 1
@xzcyr
e,一般的图例不是一般是线或者点吗,那如果我想特别点,搞一个误差棒的样子(见下图),该如何操作,得自己画吗?
2019年01月06日 07点01分 3
你看看LegendMarkers的帮助。
2019年03月02日 07点03分
level 3
哈哈,12.0已经完美解决这个问题了,around函数来了
2019年04月19日 02点04分 4
吧务
level 15
想想还是自己实际做了一下,总之先把误差棒画出来。我就直接用程序包画了,你要自己用线拼也可以:
Needs["ErrorBarPlots`"]
marker = ErrorListPlot[{{0, 1}}, PlotRange -> All,
Axes -> None] /. (Hue | RGBColor)[__] :> Sequence[]
(* 然后再用PointLegend并适当调整LegendMarkerSize就行了 *)
ListPlot[{Sqrt[Range[50]], Power[Range[50], (3)^-1]},
PlotLegends -> PointLegend[Automatic, LegendMarkers -> marker, LegendMarkerSize -> 50]]
2020年05月02日 05点05分 6
1