# Ticket #12090: trac_12090-pseudolines-braid.patch

File trac_12090-pseudolines-braid.patch, 3.0 KB (added by ncohen, 8 years ago)
• ## doc/en/reference/plotting/index.rst

```# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1369409081 -7200
# Node ID 70cbe0398c9b09b2cc7f14ee7bdef7f8e475304f
# Parent  a0c4ef907d2d77a277119b8fbd8d46d4869e8645
Arrangements of pseudolines -- pseudolines use the braid plot

diff --git a/doc/en/reference/plotting/index.rst b/doc/en/reference/plotting/index.rst```
 a =========== .. toctree:: :maxdepth: 2 :maxdepth: 1 sage/plot/plot sage/plot/graphics
• ## sage/geometry/pseudolines.py

`diff --git a/sage/geometry/pseudolines.py b/sage/geometry/pseudolines.py`
 a **Felsner's Matrix** Felser gave an encoding of an arrangement of pseudolines that takes `n^2` bits instead of the `n^2log(n)` bits required by the two previous encodings. instead of the `n^2log(n)` bits required by the two previous encodings. Instead of storing the permutation ``[3, 2, 1]`` to remember that line `l_0` crosses `l_3` then `l_2` then `l_1`, it is sufficient to remember the positions if i > 0 and seq[i-1] is not []: i -= 1 else: i += 1 i += 1 else: i += 1 else: ... ValueError: There has been a problem while plotting the figure... """ x = 1 from sage.plot.line import line from sage.plot.text import text lines = [[(0,self._n-1-i)] for i in range(self._n)] crossings = [] ends = range(self._n) for i,j in self.transpositions(): iy = lines[i][-1][1] jy = lines[j][-1][1] iy = ends[i] jy = ends[j] lines[i].append((x, iy)) lines[j].append((x, jy)) crossings.append(max(jy,iy)) ends[i] = jy ends[j] = iy if abs(iy-jy) != 1: raise ValueError( "There has been a problem while plotting the figure. It "+ "seems that the lines are not correctly ordered. Please "+ "check the pseudolines modules documentation, there is a " +"warning about that. ") +"warning about that.") lines[i].append((x+2,jy)) lines[j].append((x+2,iy)) x += 2 L = line([(1,1)]) for i, l in enumerate(lines): l.append((x+2, l[-1][1])) L += line(l) L += text(str(i), (0, l[0][1]+.3), horizontal_alignment="right") L += text(str(i), (x+2, l[-1][1]+.3), horizontal_alignment="left") return L.show(axes = False, **args) from sage.plot.braid_plot import braid_plot braid_plot(self._n, crossings, orientation="left-right").show(**args) def __repr__(self): r"""