Question: ```
String query1 =  "START
  a=node:node_auto_index(name=\"A\"),
  m=node:node_auto_index(name=\"M\"),
  b=node:node_auto_index(name=\"G\")
  MATCH  p=a-[*]-b-[*]-m " + 
  WHERE ALL(r in RELS(p) WHERE r.value >= 200) " 
  +   "WITH a, m, MIN(LENGTH(p)) AS l
  MATCH p=a-[*]-b-[*]-m WHERE ALL(r 
   in RELS(p) WHERE r.value >= 200)" +
  " AND LENGTH(p)=l RETURN p order by length(p) desc "; //limit 2
ExecutionResult eResult = exEngine.execute(query1);

```

I am using above query to get all paths between two nodes. how can I iterate over returning RelationShips.

Answer: 
### fix in R

```
Sys.getenv('DISPLAY')
Sys.setenv("DISPLAY"=":0.0")
X11()
qplot(...)
.Devices
device.list()

```

should do it.

---

### fix in tmux

You can also type `Ctrl`+`b`, `:setenv DISPLAY :0.0` to change it from `tmux` rather than from `R`.

---

Why does this happen?
---------------------

It might have to do with where you open the tmux (virtual terminal versus GNOME terminal) when you initially run the command `tmux` to initiate the session manager.

It's good to `echo $DISPLAY` in the terminal and `Sys.getenv("DISPLAY")` in R. See stuff like <https://unix.stackexchange.com/questions/31283/error-in-r-unable-to-open-connection-to-x11>

You can also run `capabilities()` in R and if `capabilities()$X11 == FALSE` then that's what to work on fixing.

I messed around for a while and then was able to do `X11(); qplot( my.ggplot )`. Check `?X11` for a little more information too.
It would help if you included the error message, but it sounds like your `DISPLAY` environment variable isn't set properly inside `tmux`. Issue `echo $DISPLAY` from outside your `tmux` session, and make sure `DISPLAY` is set to the same thing inside `tmux`.

You can use the `update-environment` command in `tmux` to configure `tmux` so that it automatically updates particular `tmux` environment variables with their values from the external environment. See the [tmux manpage](http://www.openbsd.org/cgi-bin/man.cgi?query=tmux&sektion=1) for details, or search the web for "tmux update-environment" for various other pages that describe this feature.