Graphing with Gnuplot and Xmgr
Three dimensional surfaces can be generated with the splot command, which has syntax almost identical to plot. An additional range specifies the range of the y variable and the set view command lets the user control the orientation of the plot in space. A simple example would be:
splot x*x-y*y title "Hyperbolic Paraboloid"
Gnuplot also supports hiding lines that are behind other lines with the hidden3d parameter: set hidden3d.
Gnuplot can plot “parametric” functions. A parametric function is one in which both the x and y coordinates are functions of a third variable, which in Gnuplot is t. For example:
set parametric plot 2*sin(t), 2*cos(t)
produces a circle of radius 2. The command:
set trange <range>
sets the values of t that are evaluated. Parametric plots are also valid while doing a three-dimensional splot. In this case, the independent variables under gnuplot are u and v.
Gnuplot can also take data points from the standard output of a Unix command specified on gnuplot's command line. This allows the display of points generated from almost any source. The command should be specified like a filename, preceded by a < character.
Xmgr is oriented more towards plotting data created from an external source, as opposed to plotting a given mathematical function. Xmgr normally reads files, but can also take input piped from its standard input. Once data has been read into an xmgr set, it can be displayed, scaled, and manipulated in many ways.
Xmgr also has an on-line help. When the “help” menu is selected, xmgr runs your favorite HTML browser (Mosaic by default) with the xmgr documentation as input. Several sites on the internet have this page on-line. If you don't have a browser, you end up having to read raw html. Having a program's documentation as a hypertext document is quite nice, as you can jump from subject to subject as well as being able to do text searches. A gallery of graphs produced by xmgr is also included with the xmgr distribution, which gives the user a visual look at the wide range of effects possible with xmgr.
The first step in graphing some data is to read the data into xmgr. The “Read Sets...” option under “File” produces a file browser from which a file can be selected. Several types of data can be read in, but the two column “XY” format is the most common. The format of the data is much the same as in gnuplot—individual points on lines by themselves separated by spaces or tabs. Lines beginning with # are also considered comment lines, and lines without numeric data (like a blank line) separate sets. Lines beginning with the @ symbol can control the actions of xmgr separately from the user.
Xmgr data sets are somewhat like registers, in that only a fixed number are available (fixed at compile time), and they are referred to by number. Once the data is in a set, it is displayed immediately. The left hand side of the xmgr window contains a number of buttons that provide shortcuts for various operations.
Most of the shortcut buttons let the user change the appearance of the graph interactively. A set of four arrow buttons scrolls the data in all four directions—tick marks and tick labels are automatically updated. The “Z” and “z” buttons allow uniform zooming in and out. Arbitrary zooms in are accomplished by using the magnifying glass button. This prompts the user for a rectangle that becomes the new limits of the graph. A text line at the top of xmgr's window constantly displays the current position of the mouse, in the coordinates of the graph. A crosshair extending the length and breadth of the window may be toggled to help position the mouse within a pixel of the desired point.
The “autoO” button provides an autoscaling feature. The cursor changes to a crosshair, which when clicked at some point selects the set nearest to the clicked point. The graph is rescaled such that all points in this set are visible. The “autoT” button immediately rescales the tick marks that can get cramped while doing a zoom.
Each data set has several attributes that control how the set is displayed—which symbol is used for points, the color of the symbol, whether the symbols are connected by lines or not, the color and style of the lines, the legend associated with the data set, and more. One rather packed menu controls all these options.
The user has a great deal of control over how the graph is displayed. Major and minor tick marks chosen by xmgr can be overridden. Simple box and line graphics as well as text strings can be drawn at arbitrary locations. All strings can be displayed in a variety of fonts and sizes, with subscripts, superscripts and some special characters available.
To repeat the earlier example using gnuplot, Figure 2 shows the xmgr display immediately after loading the hits file. Figure 3 shows the symbols and legends menu used to control the appearance of the set and the set's legend respectively, while Figure 4 shows the results. Figure 5 shows us getting ready to fix the X-axis by replacing the numbers with month names with the result in Figure 6. Figure 7 is after the final touch-up, adding a title, giving the Y-axis a name, getting rid of the tenths digit in the tick labels and expanding the X-axis to fill the entire bottom of the graph. Figure 8 is the final PostScript output.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- Swap Your Laptop for an iPad + Linode
- Building an Open-Source House
- An Automated Reliable Backup Solution
- Tech Tip: Really Simple HTTP Server with Python
- Stupid tar Tricks
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Acquia Founder, Drupal Project Creator Dries Buytaert Named a Young Global Leader by the World Economic Forum
- Getting Rid of Spam
- QuickStart: Replication & Recovery 1.2
- 1998 Atlanta Linux Showcase
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




3 hours 42 min ago
6 hours 14 min ago
7 hours 31 min ago
8 hours 6 min ago
8 hours 29 min ago
13 hours 17 min ago
14 hours 4 min ago
15 hours 38 min ago
17 hours 15 min ago
19 hours 12 min ago