Quantum Bayesian Networks

December 18, 2013

In Love With Inkscape

Filed under: Uncategorized — rrtucci @ 8:10 pm

From time to time, I write posts rhapsodizing software programs that might be of interest to the budding quantum computer researcher. Recently, I’ve fallen in love with Inkscape, a software program for drawing high quality vector graphics figures. Inkscape is exquisitely designed and very powerful, a true labor of love. And it’s free, very stable and multi-platform!

For LaTex users, Inkscape is a godsend because it ALLOWS YOU TO USE LATEX INSIDE A FIGURE, and then it allows you to save the figure as an .eps (encapsulated postscript) file, which is a vector graphics format that LaTex likes. Unless you ask Inkscape to save in another format like .eps, it saves files as .svg (scalable vector graphics), another vector graphics format.

If you use pdfLatex instead of the original LaTex, you can display figures that are .jpg or .png, but those are raster graphics instead of vector graphics. (pdfLatex also accepts figures in .pdf, which can be vector graphics if they are generated and saved by software like Inkscape). Raster graphics is good for photos with lots of colors and color gradients, but not so good for figures composed mainly of simple line segments and just a few colors, as are most of the figures found in physics and mathematics papers. Not so good because raster graphics files (1) don’t scale well, becoming blurry upon zooming in, (2) are too big in file size compared to vector graphics files when dealing with simple line drawings.

Another big bonus of Inkscape is that it works hand in glove with plots generated by Octave. (Octave, another wonderful and free software program, is a partial clone of MatLab). For example, here is an Octave .m file that draws a simple 2D plot on the screen, and also saves the plot as an .svg file. This is the .svg file that the .m file generates. (Web browsers can open .svg files, just like they can open many other types of graphic formats). You can open this .svg file with Inkscape, touch up the figure (for instance, add to it some LaTex insets), and then ask Inkscape to save it as an .eps file. Everything a LaTex user burning to show some plots in his LaTex paper could wish for.

(Octave gives you the option of plotting with either the OpenGL or GnuPlot plotting engines. Both engines allow you to save your graph in .svg or .eps formats, and many other graphics formats too).

(When confronted with plottable data, my first impulse is always to download it to a spreadsheet like Excel or Calc, the OpenOffice equivalent of Excel, and then to plot things there. This is a very good first step, but unfortunately, the plots generated by Excel cannot be saved in a vector graphics format, at least not in the old version of Excel that I have. So after using Excel to decide exactly what are the best things to plot, I re-plot with Octave and touch up with Inkscape as described above).

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: