![]() | |
![]() |
![]() ![]() ![]() ![]() |
![]() |
Sometimes one wants to make two axes in one figure --- for example, the X-axis is a temperature which is represented by both Celsius (C) and absolute (K). There are several ways to do it, for example, display two figures by multiplot, or use the opposite axis. Here is an example of use of multiplot. Let's make two X-axes. At first, make the figure height smaller, set the bottom margin zero, then enter the multiplot mode.
Raise the figure slightly, and plot the first graph. In a following example we draw a function y=exp(x)-1. The unit of x is "minutes".
Now, lower the figure, and draw the X-axis only. To avoid overlapping, adjust tics by set noytics , set xtics nomirror . Finally, plot a function which does not fit to the current drawing (I mean, it is outside the graph). In this example it was y= -1
![]() Well... probable there are more elegant ways to do it than this example, but practically it is no problem. It is not easy to adjust precisely the distance between two X-axes. To make it easier, add a new axis with other drawing programs other than gnuplot such as Tgif. |
The command set grid makes grid lines at the major tics positions, and those are equidistant usually. To make the grid at an arbitrary position, adjust the major tics position by the command set tics . In the following example, three tics are displayed at 0.5, 1.2, and 2.5 by the set xtics command.
![]() In order to make the arbitrary grid keeping the tic position equidistant, use the opposite axis. Choose the grid positions by set x2tics , then make the grid according to the X2 axis by set grid command option.
![]() If you want to remove numbers at the top of this figure, set x2tics "" 0.5 . Those numbers disappear but X2 major tics still remain. |
![]() | |
![]() |
![]() ![]() ![]() ![]() |
![]() |