Mathematica PlotMarkers 中标记的自定义间隔 [英] Custom Intervals of Markers in Mathematica PlotMarkers

查看:164
本文介绍了Mathematica PlotMarkers 中标记的自定义间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 Mathematica (ListLinePlot) 的同一个图中绘制多个列表,并使用 PlotMarkers 和 PlotLegend 包来获得最终数字.问题是 Mathematica 为每个点放置了一个标记,这使得很难分辨哪个标记在图中的哪个位置.是否可以每 n 个样本出现一个绘图标记(例如,对于 100 点绘图,每 10 个点出现一次).

I am trying to plot multiple lists in the same plot in Mathematica (ListLinePlot) and use PlotMarkers and the PlotLegend Package to get the final figure. The issue is that Mathematica puts a marker for every point and this makes it hard to tell which marker is where in the plot. Is it possible to have a plot marker appear every n sample (e.g. every 10 points for a 100 point plot).

目前的指令是 PlotMarkers->{Automatic, Small}.

The Directive at the moment is PlotMarkers->{Automatic, Small}.

推荐答案

如果您想要比 Brett 的答案 给了您,那么您可能必须手动放置标记.例如(修改布雷特的例子)

If you want more control over the location of the plot markers than Brett's answer gives you, then you probably have to place the markers manually. Eg (modifying Brett's example)

data = Accumulate /@ RandomReal[{-1/2, 1}, {3, 100}];
col = {Red, Blue, Green};
decimate[i_] := {col[[i]], PointSize -> Medium, 
  Point /@ Transpose[{Range[1, 100, 10], data[[i, 1 ;; -1 ;; 10]]}]}
ListLinePlot[data, PlotStyle -> col, Epilog -> Table[decimate[i], {i, 3}]]

当然 Point 可以替换为任何你想要的图形对象 - 例如 TextInset 等...

Of course Point can be replaced with any graphics object you want - eg Text, Inset etc...

这篇关于Mathematica PlotMarkers 中标记的自定义间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆