07
Apr

easily Draw Figures with Latex PStricks

In scientific publications, it is usually a good idea to have figures to illustrate how the theory works intuitively. But drawing a figure in Latex could be very time consuming. Here I introduce an easy way to draw figures in Latex. It was first discovered by my supervisor Wiebe.

Follow these steps:

  1. Make sure that you have Pstricks packages for Latex.
  2. Download Free Software Package(licenced under GNU GPL) from LaTeXDraw website. (It is in Java, so it works with all major platformes Linux/Mac/Windows.)
  3. Install LaTexDraw, and launch it, then you will see an editor like this:

    (Top area is a list of icons which represent various functions; left part of the main area is for you to draw figures; right part of the main area shows the corresponding PStricks code for this figure.)
  4. Copy the codes on the right side and paste them into your latex document.
  5. Done.

Isn’t it simple?

Here is a figure in full size:

Here is the PStricks codes for the above figure:

% Generated with LaTeXDraw 1.9.5
% Mon Apr 07 19:59:11 BST 2008
% \usepackage[usenames,dvipsnames]{pstricks}
% \usepackage{epsfig}
% \usepackage{pst-grad} % For gradients
% \usepackage{pst-plot} % For axes
\scalebox{1} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-2.35)(9.26,2.37)
\pswedge[linewidth=0.04](2.33,0.02){2.33}{23.60019}{337.2035}
\psdots[dotsize=0.6](2.08,1.01)
\psdots[dotsize=0.12](6.92,-0.05)
\psarc[linewidth=0.04](2.05,1.02){0.55}{0.0}{180.0}
\psdots[dotsize=0.12](6.28,-0.01)
\psdots[dotsize=0.12](5.68,-0.01)
\psdots[dotsize=0.12](5.14,0.01)
\psdots[dotsize=0.12](4.74,0.03)
\psdots[dotsize=0.12](4.42,0.05)
\psellipse[linewidth=0.04,dimen=outer](7.62,1.62)(0.46,0.59)
\psbezier[linewidth=0.04](7.68,1.03)(7.92,0.53)(8.16,-0.27)(7.84,-0.77)
\psbezier[linewidth=0.04](8.28,-2.33)(8.62,-1.59)(8.2,-1.11)(7.86,-0.77)
\psline[linewidth=0.04cm](8.28,-2.33)(8.66,-2.21)
\psbezier[linewidth=0.04](7.84,-0.75)(7.4,-1.25)(7.2,-1.89)(7.42,-2.29)
\psline[linewidth=0.04cm](7.4,-2.27)(7.1,-2.23)
\psbezier[linewidth=0.04](7.8,0.71)(8.4,0.71)(9.24,0.27)(8.0,-0.13)
\psline[linewidth=0.04cm](8.04,-0.13)(8.44,-0.25)
\psbezier[linewidth=0.04](7.84,-0.11)(7.241167,-0.011286241)(6.5192637,0.49325243)(7.806186,0.69679886)
\psline[linewidth=0.04cm](7.88,-0.11)(7.4703093,-0.27982286)
\end{pspicture}
}

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

No Comments

(Required)
(Required, will not be published)