Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #856

Re: Dynamically setting mxtics between two xtics

From Ingo Thies <ingo.thies@gmx.de>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Dynamically setting mxtics between two xtics
Date 2012-01-18 18:25 +0100
Message-ID <9nodjvF3gsU1@mid.individual.net> (permalink)
References <171a69a5-1063-43b2-94e4-c498b855ed2e@a17g2000yqj.googlegroups.com> <9nad3nFvm5U1@mid.individual.net> <3bed6fda-db9e-481c-9e7f-8cf58a01202e@q8g2000yqa.googlegroups.com>

Show all headers | View raw


Hi!

> What I want is a mxtic for each data point.
> I am not able to figure out how to gnuplot decides the interval of a
> xtic.
> Can you please share the way to figure out the same.

In this case, I only see the way via arrows. If you have written by
yourself the program that generates the data, then you can include an
output statement to a file that generates lines like

set arrow iarr from xpos,y0 to xpos,y1 nohead

where xpos is the x value of your data point, y0 is the lower y-border
displayed in your graph, and y1 is y0 plus some length.

Another possibility might be to fake tics by using points of type 1
(i.e. crosses) of appropriate size, but this would generate tics in both
directions away from the x-axis. But it could be done inside a gnuplot
script, where you take the x value directly and replace the y value with
the minimum y.

I know, these are more or less dirty hacks, but the former one really
works nicely, and even allows slanted irregular tics (remember the
Planck locus in the color space plot from Wikipedia).

Another hack that might work uses manually set tics using

set xtics ("<label1>" <x1>, "<label2>" <x2>,...)

where "label" stands for any string (in your case maybe just blank), and
x1,x2... stands for your x positions. This, however, would probably
again require some modifications to your data-generating program. Maybe
it could also be done with some awk script, but I am not an expert on
this. If you also want regularly labelled major xtics at the same time
you have to use x2tics instead and set x2range to the same borders as
xrange. I have not yet looked up, but maybe you can set xtics and x2tics
to different styles (i.e. lengths), so that the manually set xtics
appear like minor tics, while the major x2tics have normal size.

In my opinion, the program-generated "set arrow" statements are the
least painful way to do this.

HTH,

Ingo

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Dynamically setting mxtics between two xtics Satish Thareja <satishthareja@gmail.com> - 2012-01-11 23:06 -0800
  Re: Dynamically setting mxtics between two xtics Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-01-12 19:46 +0100
  Re: Dynamically setting mxtics between two xtics sfeam <sfeam@users.sourceforge.net> - 2012-01-12 13:01 -0800
  Re: Dynamically setting mxtics between two xtics Ingo Thies <ingo.thies@gmx.de> - 2012-01-13 10:50 +0100
    Re: Dynamically setting mxtics between two xtics scanty <satishthareja@gmail.com> - 2012-01-18 05:12 -0800
      Re: Dynamically setting mxtics between two xtics Ingo Thies <ingo.thies@gmx.de> - 2012-01-18 18:25 +0100
        Re: Dynamically setting mxtics between two xtics ab <ab.3942@googlemail.com> - 2012-01-19 00:43 -0800
          Re: Dynamically setting mxtics between two xtics scanty <satishthareja@gmail.com> - 2012-01-23 03:38 -0800
            Re: Dynamically setting mxtics between two xtics Ingo Thies <ingo.thies@gmx.de> - 2012-01-23 16:25 +0100

csiph-web