Drawing vector graphics using a command line

Liam Proven lproven at gmail.com
Mon Sep 21 13:51:16 UTC 2015


On 20 September 2015 at 21:52, John D Lamb <J.D.Lamb at johndlamb.net> wrote:
> On 20/09/15 13:44, Johnny Rosenberg wrote:
>>
>> Anyone know of a tool to create SVG files (or similar) using some kind
>> of macro or command line?
>
>
> Two suggestions.
>
> First, if you can tolerate encapsulated postscript, you can use LaTeX. The
> following is an example I used recently:
>
> \documentclass{article}
> \usepackage{mathptmx}
>
> %% Pictures
> \usepackage{pst-pdf,pst-node}
>
> \begin{document}
> \begin{pspicture}[showgrid=false](0,0)(2,2)
>   \psset{arrows=->}
>   \rput(0.529,0.353){\dotnode{V1}}
>   \rput(1.470,0.353){\dotnode{V2}}
>   \rput(1.712,1.247){\dotnode{V3}}
>   \rput(1.000,1.800){\dotnode{V4}}
>   \rput(0.239,1.247){\dotnode{V5}}
>
>   \ncline[linestyle=dashed]{V1}{V2}
>   \ncline{V3}{V2}
>   \ncline{V4}{V3}
>   \ncline{V5}{V4}
>   \ncline{V1}{V5}
> \end{pspicture}
> \end{document}
>
> This draws a pentagon with dashed and solid lines and nodes at the vertices.
> To convert to pdf use estopdf.
>
> I used to write raw PostScript. But I rarely do this now that the LaTeX
> PSTricks packages do what I want for simple graphics and R can handle the
> really complex stuff.
>
> Second, IIRC SVG is a language you can just write. Have a look at some of
> these examples: http://www.w3schools.com/svg/svg_examples.asp. I have
> written some SVGs several years back, but usually I need pdf or eps format
> nowadays.


The trusty standby xterm, preloaded onto almost all Linux distros,
supports Tektronix graphics terminal drawing commands...

http://stackoverflow.com/questions/2114347/raster-graphics-in-xterm


-- 
Liam Proven • Profile: http://lproven.livejournal.com/profile
Email: lproven at cix.co.uk • GMail/G+/Twitter/Flickr/Facebook: lproven
MSN: lproven at hotmail.com • Skype/AIM/Yahoo/LinkedIn: liamproven
Cell/Mobiles: +44 7939-087884 (UK) • +420 702 829 053 (ČR)



More information about the ubuntu-users mailing list