1

I have plotted a graph using xmgrace where I am interested in two extreme portions only on x axis and I do not want to see the region in between. How can I do that?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
sharma
  • 11
  • 3

1 Answers1

1

Since you didn't provide any data I created a 2-column data file data.dat based on the mathematical function y(x) = 1/x where -2 <= x <= 2:

#x  1/x
-2  -0.5
-1.99   -0.5025125628
-1.98   -0.5050505051
-1.97   -0.5076142132
[....]

In this plot I have already adjusted the y axis range to focus on the function around the singularity:

f(x) = 1/x

Supposing we want to plot this in xmgrace without the singularity at x = 0. I suggest the following:

  1. In the "Graph Appearance" window duplicate the graph G0.
  2. In the "Viewport" settings for the two graphs G0 and G1, modify the x ranges so that they sit side-by-side.
  3. "Focus to" G1 by right-clicking on it and selecting "Focus to" then modify the y axis so that there is no label and no tick labels are shown.
  4. Likewise, modify the axis range for both graphs so that they only show a portion of the function. For example, I chose the range -2 <= x <= -0.01 for G1 and 0.01 <= x <= 2 for G1.

After modifying the major tick spacing this is the result:

Xmgrace plot with split axes

Unfortunately xmgrace does not have unlimited flexibility. If you want more control you could look into a scripted plotting package such as matplotlib.

feedMe
  • 3,431
  • 2
  • 36
  • 61