# VTK Examples - Graph Testing

**URL:** https://discourse.vtk.org/t/vtk-examples-graph-testing/5561
**Category:** Development
**Created:** [April 17, 2021, 1:50am UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561 "2021-04-17T01:50:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [April 17, 2021, 1:50am UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561/1 "2021-04-17T01:50:01Z")

</div>

I have come across an interesting discrepancy in testing [vtk-examples](https://gitlab.kitware.com/vtk/vtk-examples). The following five tests all pass in Windows but fail in Linux:

- [ConstructGraph](https://kitware.github.io/vtk-examples/site/Cxx/Graphs/ConstructGraph)
- [EdgeWeights](https://kitware.github.io/vtk-examples/site/Cxx/Graphs/EdgeWeights)
- [RandomGraphSource](https://kitware.github.io/vtk-examples/site/Cxx/Graphs/RandomGraphSource)
- [ScaleVertices](https://kitware.github.io/vtk-examples/site/Cxx/Graphs/ScaleVertices)
- [SideBySideGraphs](https://kitware.github.io/vtk-examples/site/Cxx/Graphs/SideBySideGraphs)  
These five examples in Linux mirror the graph image around a central vertical axis when compared to the Windows image. All the examples above show the windows image, for Linux I am getting an image like this:

![TestConstructGraph](https://discourse.vtk.org/uploads/default/original/2X/d/dd7e5d72a27117ae5c2106dbf106810967c2925b.png)

for `ConstructGraph`, compare this with the Windows image here: [ConstructGraph](https://kitware.github.io/vtk-examples/site/Cxx/Graphs/ConstructGraph).

Alternatively this shows the mirroring around the central vertical line of the image more clearly:

![TestScaleVertices](https://discourse.vtk.org/uploads/default/original/2X/8/85d9994f0c40a01856f852d2fe07b18f42f3f581.png)

for `ScaleVertices`, compare this with the Windows image here: [ScaleVertices](https://kitware.github.io/vtk-examples/site/Cxx/Graphs/ScaleVertices).

The tests were run using Windows 10 Visual Studio 2019 16.4 and Kubuntu gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0 using the latest VTK Master.

Has anyone any ideas why these examples show this reflection in Linux when compared to Windows? If someone has time and a Mac I would be interested to know if the Mac image matches either Windows or Linux.

At this stage around 1000 of the C++ VTK Examples examples are tested with just two failures in Windows and these five failures in Linux (with an additional one: [XGMLReader](https://kitware.github.io/vtk-examples/site/Cxx/InfoVis/XGMLReader/)).

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [April 17, 2021, 5:33am UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561/2 "2021-04-17T05:33:56Z")

</div>

Perhaps it is not mirroring but showing the image from behind. i.e. flipping the z axis. Maybe left handed vs right handed coordinate systems for Windows vs Linux or vice versa?

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [April 17, 2021, 7:11am UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561/3 "2021-04-17T07:11:16Z")

</div>

That’s a possibility. However the labelling is Ok. This is puzzling because the same classes are used elsewhere in the examples and results are identical in Windows and Linux.

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [April 17, 2021, 7:14am UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561/4 "2021-04-17T07:14:05Z")

</div>

Can you display the camera axes in each?

Examples for shapes with a YZ plane of symmetry would appear to be identical.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [April 17, 2021, 7:30am UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561/5 "2021-04-17T07:30:03Z")

</div>

That’ s a good point. I’ll have a go at that tomorrow.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [April 29, 2021, 6:50am UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561/6 "2021-04-29T06:50:31Z")

</div>

The problem seems to be that the default layout: `Simple 2D` seems to give different results in Linux and Windows. I updated these examples to use `Force Directed` and the results now are consistent across Linux and Windows.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [May 15, 2021, 7:37pm UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561/7 "2021-05-15T19:37:36Z")

</div>

Please file an issue that `Simple 2D` is platform-dependent.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [May 16, 2021, 6:16am UTC](https://discourse.vtk.org/t/vtk-examples-graph-testing/5561/8 "2021-05-16T06:16:48Z")

</div>

Done, please see: [https://gitlab.kitware.com/vtk/vtk/-/issues/18212](https://gitlab.kitware.com/vtk/vtk/-/issues/18212)
