caten2 / Tripods2021UA

MIT License
3 stars 5 forks source link

Better visualizations for binary relations #22

Open caten2 opened 10 months ago

caten2 commented 10 months ago

As you can see in the current version of src/relations.py there is a show method for the Relation class which has an optional argument of special_binary_display. This could be improved in a number of ways to help with visualizing binary relations. This issue is pretty open-ended, but here are some suggestions for ways to improve this.

  1. Instead of the existing options, one could have a general method where the true/false values can be represented by any chosen characters or even strings. For example, the choice 'binary_pixels'would correspond to sending true to 1 and false to 0.
  2. We don't have to just output by printing something. You could also output latex source code that describes a matrix of entries, or even use tikz or asymptote to draw something.
  3. It's not necessary to create a literal picture. We could also represent a binary relation as a directed graph, for example. Another possibility is grouping, say 2 by 2 blocks of the image together and then using a greyscale value to represent how many pixels in the 2 by 2 block are black.
  4. You might also consider an option where you save an image file or save any code you generate as a text file instead of printing it out. If you want to make images to save, one option is Mathplotlib.
caten2 commented 9 months ago

I added an option to create LaTeX matrices of zeroes and ones for binary relations in the most recent addition to the path_archtecture branch.