Menu

specifying constant space between graph and color box

Help
2016-11-21
2016-11-22
  • Marvin Raaijmakers

    I have a document with several plots that I make using gnuplot via the gnuplottex package (and epslatex terminal). I give each plot a screen width equal to \columnwidth. However the graphs have different width. I noticed that the width of the color box and the space between the graph and the colorbox is proportional to the width of the graph. Now I think this looks pretty inconsistent within one document where the graphs have different width and even results in really ugly plots of the graph width is relatively small.

    So I would like to specify the width of the color bar and the space between the color bar and the graph to be constant over all plots in my document. Now I am able to get a constant width by specifying the width in character coordinates. However, after reading gnuplot's documentation about coordinates, it seems impossible to me to specify a constant space between the color box and graph: in order to specify the color box's position relative to the graph I need to specify it in graph coordinates, but in order to specify an contant offset I need to use character coordinates. A combination of both does not seem possible.

    Now I hope that I am wrong about this and that someone can tell me how I can do this. If it's not possible then I am pretty shocked about this since I think this requirement of mine is not a very exotic one.

     
    • Ethan Merritt

      Ethan Merritt - 2016-11-22

      The recommended way to make plot borders line up consistently is to place them using the
      commands

         set lmargin at screen <left border coord>
         set rmargin at screen <right border coord>
      

      and so on. The program will then place other elements (axis labels,
      title, color box, etc) relative to these positions.
      If necessary you can also specify the precise position and size
      of the color box.

      See for example:

      http://gnuplot.sourceforge.net/demo_cvs/margins.html
      
       

      Last edit: Ethan Merritt 2016-11-22

Log in to post a comment.