Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This one is actually a doosie and I can't make it happen without some *nix shell magic.</p> <p>First, we want to get the x tic labels and y tic labels:</p> <pre><code>XTICS="`awk 'BEGIN{getline}{printf "%s ",$1}' test.dat`" YTICS="`head -1 test.dat`" </code></pre> <p>At this point, XTICS is the string "F G H I J" and YTICS is the string "A B C D E".</p> <p>Now, we want to set the xtics by iteration:</p> <pre><code>set for [i=1:words(XTICS)] xtics ( word(XTICS,i) i-1 ) set for [i=1:words(YTICS)] ytics ( word(YTICS,i) i-1 ) </code></pre> <p>We've used 2 gnuplot builtin functions (<code>word</code> and <code>words</code>). <code>words(string)</code> counts how many words there are in the given string (a word is a character sequence separated by spaces). <code>word(string,n)</code> returns the n'th word in the string.</p> <p>Now, we can plot your datafile ... The only problem is that <code>matrix</code> wants to use <em>all rows and columns in your datafile</em>. You might be able to cut down the rows/columns actually read by using the <code>every</code> keyword, but I don't know how to do that on matrix files -- and I think it's probably easier to just keep on relying on shell utilities (<code>awk</code> and <code>sed</code>)</p> <pre><code>plot "&lt;awk '{$1=\"\"}1' test.dat | sed '1 d'" matrix w image #######^ replace the first field with nothing ################################## ^ delete first line </code></pre> <p>And now your plot (hopefully) looks the way you want it to.</p> <p><em>Also note that since we have used iteration, this script will only work in gnuplot 4.3 or higher -- Since the current stable is 4.6, hopefully that's Ok.</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload