# Code to Draw

“Wow! I can do this?” this was my reaction when I was introduced to DOT.

Now the question arises what is DOT ?  Well lets see what [Wikipedia](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) says about DOT.

> **DOT** is a plain text [graph](https://en.wikipedia.org/wiki/Graph_(discrete_mathematics) "Graph (discrete mathematics)") description language. It is a simple way of describing graphs that both humans and computer programs can use. DOT graphs are typically [files](https://en.wikipedia.org/wiki/Computer_file "Computer file") that end with the _.gv_ (or _[.dot](https://en.wikipedia.org/wiki/.dot_(disambiguation) ".dot (disambiguation)")_) [extension](https://en.wikipedia.org/wiki/File_extension "File extension"). The _.gv_ extension is preferred in cases where there could be confusion with the _.dot_ file extension used by early (pre-2007) versions of [Microsoft Word](https://en.wikipedia.org/wiki/Microsoft_Word "Microsoft Word").[\[1\]](https://en.wikipedia.org/wiki/DOT_(graph_description_language)#cite_note-1)

Having said that this is a really nifty and an amazing peace of code written to help people like me who can’t draw. I had to draw diagrams for few of the projects I have been involved in and I was looking for a way that I can achieve this without much effort.

DOT came to my rescue , it solved my problem to an extent I will try to give you example of how simple DOT code and expected output

<pre>digraph graphname {  
a -> b -> c;  
b -> d;  
}</pre>

This is how the code looks like in DOT , but the output might astonish you .

![dot2](https://cdn.hashnode.com/res/hashnode/image/upload/v1622182539750/0_ImGxABw.png)

This is the magic of DOT. Very less effort required yet you will get all the benefit of making a diagram. This for me is a boon.

The next thing which comes to rescue is ascii art, well lets agree to this that ASCII art is beautiful, you can draw ascii art either on http://asciiflow.com/ or for Vimmers there is a plugin [DrawIt](http://howto.lintel.in/create-ascii-art-using-vim-plugin-drawit/) . These can be used to draw something which looks like ASCII drawing.

![Selection_008](https://cdn.hashnode.com/res/hashnode/image/upload/v1622182541125/3_8yLYANA.png)

This is how ASCII art with vim looks like , now not only that , this ascii art can be converted into a png file which looks like rather is a image , for that for that we use something called [Ditaa](http://ditaa.sourceforge.net/), a java library to convert ascii art into png image file. So after  using Ditaa, the art looks like this.

![hello](https://cdn.hashnode.com/res/hashnode/image/upload/v1622182542485/BUqnNzvK2.png)

I found it pretty cool, this is how you make txt to png, these tools really come handy when you are preparing some presentation or trying to visualize something or trying to explain something.

Do experiment with it and let me know your experience.

Keep coding!! ![🙂](https://cdn.hashnode.com/res/hashnode/image/upload/v1622182543695/oOp9A1sAs.png)
