I would say that it depends on what you want exactly to do. If you need to draw some graph once (I personally use tikz within latex files) or if you need to draw graphs very often, and the reason why you want to show these graphs. If you want to illustrate, for instance, the result of the application of an algorithm it might be a good solution to use an API that display graphs and allow you to generate images from this software. A good example is GraphStream (http://graphstream-project.org), for which you have a demonstration on youtube (https://www.youtube.com/watch?v=XX5rRF6uxow). A simple program like these following lines allow you to generate four nodes linked by edges to form a square and write the result in a file (png, jpg or bmp according to your choice).