在Mathematica中使用图形交叉替换磁盘 [英] Replacing Disks by Crosses using Graphics in Mathematica

查看:195
本文介绍了在Mathematica中使用图形交叉替换磁盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  dalist = {{47.9913,11.127,208},{47.5212,10.3002,208} ,
{49.7695,9.96838,160},{48.625,12.7042,436}}

那些是在每个子列表中的眼睛注视的坐标,其中
$ b #1 是X坐标,

#2 Y坐标和

#3 ,在特定位置花费的持续时间

然后我使用以下内容:

 磁盘[{#[[1]],#[[2]]},3N [#[[3]] / Total [dalist [[All ,3]]]]]& / @ dalist 

可以绘制持续时间加权直径的磁盘。



我想画两个交叉的中间交叉点,每个交点的长度等于盘的直径,如下图所示。





这就是我所拥有的

 图形[{
Line [{{#[[1]] - 3 N [#[[[ 3]] / Total [dalist [[All,3]]]],#[[2]]},
{#[[1]] + 3 N [#[[3]] / [[All,3]]]],#[[2]]}}]& / @ dalist,
Line [{{#[[1]],#[[2]] - 3 N [#[[3]] / Total [dalist [[All,3]]]]},
{#[[1]],#[[2]] + 3 N [#[[3]] / Total [dalist [[All,3]]]]}}]& / @ dalist}]

我想知道是否有更简单的方法,使用类似于PlotMarkers的东西存在于ListPlot中

解决方案

使用两行。例如:

  pointTrans = 
{
行[{{#[[1]] - l ,#[[2]]},{#[[1]] + 1,#[[2]]}}],
Line [{{#[[1]],#[[2]] - l},{#[[1]],#[[2]] + l}}]
} /。 l - > #[[3]] /意思[dalist [[All,3]]]& ;;

pointTrans / @ dalist //图形//显示


Consider the following list :

dalist = {{47.9913, 11.127, 208}, {47.5212, 10.3002, 208}, 
          {49.7695, 9.96838, 160}, {48.625, 12.7042, 436}}

Those are coordinatees of Eye fixations on a screen where, within each sublist,

#1 is the X coordinate,

#2 the Y coordinate and

#3, the duration spent at that particular location

I then use the following :

Disk[{#[[1]], #[[2]]}, 3N[#[[3]]/Total[dalist[[All, 3]]]]] & /@ dalist

to draw disk with duration weighted diameter.

I would like to draw cross instead where the 2 segments intersect at their middle and the length of each is equivalent to the disk diameter as illustrated bellow.

This is what I have yet :

Graphics[{
          Line[{{#[[1]] - 3 N[#[[3]]/Total[dalist[[All, 3]]]], #[[2]]},
                {#[[1]] + 3 N[#[[3]]/Total[dalist[[All, 3]]]], #[[2]]}}] & /@ dalist,
          Line[{{#[[1]], #[[2]] - 3 N[#[[3]]/Total[dalist[[All, 3]]]]},
                {#[[1]], #[[2]] + 3 N[#[[3]]/Total[dalist[[All, 3]]]]}}] & /@ dalist}]

I was wondering if there was a simpler way, using something similar to PlotMarkers that exist in ListPlot

解决方案

Use two lines. Something like:

pointTrans =
  {
     Line[{{#[[1]] - l, #[[2]]}, {#[[1]] + l, #[[2]]}}],
     Line[{{#[[1]], #[[2]] - l}, {#[[1]], #[[2]] + l}}]
     } /. l -> #[[3]]/Mean[dalist[[All, 3]]] &;

pointTrans /@ dalist // Graphics // Show

这篇关于在Mathematica中使用图形交叉替换磁盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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