Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can get geometry from matplotlib. Create two file <strong>subplot2grid2gnuplot.py</strong> and <strong>subplot2grid.gp</strong>. <strong>test.gp</strong> is an example of usage.</p> <p><strong>subplot2grid2gnuplot.py</strong></p> <pre><code>import matplotlib.pyplot as plt import sys if len(sys.argv)&lt;6: sys.stderr.write("ERROR: subplot2grid2gnuplot.py needs 6 arguments\n") sys.exit(1) shape = (int(float(sys.argv[1])), int(float(sys.argv[2]))) loc = (int(float(sys.argv[3])), int(float(sys.argv[4]))) colspan = int(float(sys.argv[5])) rowspan = int(float(sys.argv[6])) ax = plt.subplot2grid(shape, loc, colspan, rowspan) print "%f %f %f %f" % ax._position.bounds </code></pre> <p><strong>subplot2grid.gp</strong></p> <pre><code># Return origin and size of the subplot # Usage: # call subplot2grid.gp shape1 shape1 loc1 loc2 colspan rowspan # Sets: # or1, or2, size1, size2 aux_fun__(shape1, shape2, loc1, loc2, colspan, rowspan) = \ system(sprintf("python subplot2grid2gnuplot.py %i %i %i %i %i %i %i", shape1, shape2, loc1, loc2, colspan, rowspan)) aux_string__= aux_fun__($0, $1, $2, $3, $4, $5) or1=word(aux_string__,1) or2=word(aux_string__,2) size1=word(aux_string__,3) size2=word(aux_string__,4) </code></pre> <p><strong>test.gp</strong></p> <pre><code>unset xtics unset ytics set multiplot call "subplot2grid.gp" 3 3 0 0 1 3 set size size1, size2 set origin or1, or2 plot sin(x) call "subplot2grid.gp" 3 3 1 0 1 2 set size size1, size2 set origin or1, or2 plot sin(x) call "subplot2grid.gp" 3 3 1 2 2 1 set size size1, size2 set origin or1, or2 plot sin(x) call "subplot2grid.gp" 3 3 2 0 1 1 set size size1, size2 set origin or1, or2 plot sin(x) call "subplot2grid.gp" 3 3 2 1 1 1 set size size1, size2 set origin or1, or2 plot sin(x) unset multiplot </code></pre> <p><img src="https://i.stack.imgur.com/HhMS6.png" alt="Example"></p>
 

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