1 / 29

Vplot: The Evolution of Plotting Devices and Virtual Plot Language

Learn about the origins and development of Vplot, a virtual plot language that allowed for plotting on various graphics devices. Discover how it solved the challenge of supporting multiple devices and its influence on modern plotting technologies.

bporter
Download Presentation

Vplot: The Evolution of Plotting Devices and Virtual Plot Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Vplot(or, why I took 7 ½ years to graduate...) Joseph A. Dellinger dellinja@bp.com

  2. Where did Vplot come from? • SEP was one of the first users of Unix • Jon just loved to buy fancy new graphics devices • Gould (200 dpi printer, greasy wet plots) • Varian (300 dpi printer) • Several flavors of Tektronix • Gigi (oooh, 8 colors!) • Envision (even better, 8 _settable_ colors!) • RasterTek (the “Movie” machine: 256 settable colors! WOW!) • Each of these devices had its own proprietary protocol. • They were all buggy. • SEP wanted to plot on all the different devices!

  3. Where did Vplot come from? • Rob Clayton, circa 1979, came up with the idea of a “virtual device” and a “virtual plot language”. • This way you didn’t have to write a new program for every pairwise combination of geophysical application and plotting device! • Vplot was designed to be a superset of the various devices of the time: • 600dpi • 8 predefined, 256 user-settable colors • 4 by 3 aspect-ratio screen • screen 10.24 inches tall • a “pen” filter was written for each device to translate vplot language into that device’s language

  4. Where did Vplot come from? • Dave Hale invented a vector font for it: (Later we also added Hershey fonts, which look nicer...)

  5. Where did Vplot come from? • Each SEP student had a computer maintenance task assigned. • I was given the job of maintaining the various “pen” filters… • They contained 80% similar code, yet • they all interpreted vplot a little differently. • Maintaining all of them was a *@&^ nightmare…

  6. Solution: The device structure struct device{ /* control routines */ int (*open)(); int (*reset)(); int (*message)(); int (*erase)(); int (*close)(); /* high level output */ int (*vector)(); int (*marker)(); int (*text)(); int (*area)(); int (*raster)(); int (*point)(); int (*attributes)(); /* input */ int (*getpoint)(); int (*interact)(); }; Generic high-level routines digest complex commands into simpler ones. For example: the generic polygon fill routine draws vectors back and forth inside the polygon. If you don’t care about supporting the device efficiently, all you really need to support are a minimal few low-level routines, use the generic routines for everything else, and the device can then do “everything”. Inefficiently, perhaps, but it works. That’s how we could add “raster” capabilities to vplot and immediately have EVERY device suddenly able to do raster.

  7. Supporting a new device • First, support the commands for “move”, “draw”, “erase”, and “change drawing color”. • Add in other routines as needed to improve plotting efficiency. • One person can be writing and debugging one device-dependent routine while another person works on another. The device-independent and device-dependent parts can be worked on simultaneously as well. • Vplot has an extensive test suite that deviously exercises every part of the language, so you can test whether new code really works or not, and check that no unanticipated bugs have been introduced.

  8. This one tests whether polygon fill is working properly.

  9. This one tests whether the width of fat lines, height of characters, positions of characters, and dashed-line intervals are all true to scale.

  10. Surely we have evolved beyond vplot today? • Today our incompatible plotting devices are called: • X [8-bit, 16-bit, 24-bit, different screen resolutions and shapes...] • Color (RGB or CMYK), grayscale, monochrome • gif, tiff, jpeg, png... • Postscript level 1, Postscript level 3, encapsulated postscript… • Svg, Cairo, OpenGL…

  11. Challenges • The concept of a “virtual device” is surprisingly slippery: • Fit to screen, or true scale? • Aspect ratio of screen? (Stretchy or rigid?) • Color, black and white, true grey scale, or dithered grey? • Black background or white? If black is white, what happens to the other colors, then? Does raster invert too? What if the background is set to some other random color? • Should text scale anisotropically or not? • How to handle multi-frame plots? • How to shield the user from device inadequacies? (e.g., generic routines for missing capabilities, pixc + greyc, dithering in software, limited number of colors...)

  12. Oops, hit a bug in the ppt postscript converter! This should be a uniform grey scale. It did a really sucky job on fattening vectors, too. Letting vplot rasterize the plot produced a better result.

  13. Vplot examples • Forgotten capabilities • Mixing and matching • Manual Vplot file hacking • Repurposing a plot

  14. sfspike k1=5 n1=10 | sfgraph title=“\s200 \F11 CHebyshchev\^\s100 2” > plot.vplvplot2gif plot.vpl plot.gif fat=3 scale=1.5 yscale=.7

  15. sfpldb < fig.vpl | sed –e ‘s/Cusp/Asparagus/’ | sfplas > fig2.vplvplot2gif fig2.vpl fig2.gif yscale=.5 txscale=1.5 dashscale=3

  16. vplot2eps align.vpl align.eps fat=4 color=y

  17. vplot2eps align.vpl align.eps fat=4 color=y yscale=.6 txscale=1.2

  18. vplot2eps align.vpl align.eps fat=4 color=y yscale=.6 txscale=1.2 \ txsquare=no Programs that include text in their graphics should justify their output text properly, so that labels grow and shrink the right way.

  19. vppen: the pen filter for the virtual vplot device • There are quite a lot of parameters that can be used to transform a plot while plotting it • Once you like the result, plot it with “vppen” • It then writes back out a vplot file that will produce what you see without needing any transformation parameters

  20. vppen align.vpl fat=4 yscale=.6 txscale=1.2 txsquare=no > alignv.vplvplot2eps alignv.vpl alignv.eps color=y

  21. Other things vppen can do • Instead of plotting, it can tell you the size and position of a plot. vppen stat=y *.vpl demo_bering.vpl: h= 7.81 w= 12.07; x=( 0.42, 12.49) y=( 1.07, 8.88) demo_impulse.vpl: h= 5.85 w= 7.95; x=( 0.62, 8.56) y=( 0.77, 6.62) demo_jon.vpl: h= 6.39 w= 13.45; x=( 0.14, 13.60) y=( 0.74, 7.12) demo_reciprocity.vpl: h= 6.61 w= 6.20; x=( 0.70, 6.90) y=( 0.40, 7.01) All 4: h= 8.48 w= 13.46; x=( 0.14, 13.60) y=( 0.40, 8.88) Total 4 plot frames. It can also take apart / combine plots in various ways:

  22. vppen demo*.vpl gridnum=2,2 grid=2 > junkvplot2eps junk junk.eps color=y fat=2

  23. sfvplotdiff Vplotdiff compares two vplot files and tells you if they make “the same plot”. The line numbers in its messages correspond to the line numbers pldb uses. A surprisingly difficult task…

  24. Where to from here? • Use more of vplot’s existing features: • named groups • user-defined fonts (i.e. math ligatures?) • fonts with filled areas • hatched polygons • the “interact” option • Enhancements? • Incorporate some modern fonts (need splines) • More colors • Interface to a GUI editor? • Higher-resolution coordinates? • 3D? • Two-way communication?

  25. Thanks to all those who helped create vplot, in particular: Jon Claerbout, Rob Clayton, and Dave Hale Dave Nichols and Steve Cole Glenn Kroeger Thanks to Sergey for keeping vplot alive!

More Related