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


Groups > comp.graphics.apps.gnuplot > #3776 > unrolled thread

Re: label a scatter plot with non-clashing text labels automatically

Started byfrancis.tyers@gmail.com
First post2017-10-15 02:30 -0700
Last post2017-10-15 08:56 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: label a scatter plot with non-clashing text labels automatically francis.tyers@gmail.com - 2017-10-15 02:30 -0700
    Re: label a scatter plot with non-clashing text labels automatically Gavin Buxton <gavinbuxton@gmail.com> - 2017-10-15 08:56 -0700

#3776 — Re: label a scatter plot with non-clashing text labels automatically

Fromfrancis.tyers@gmail.com
Date2017-10-15 02:30 -0700
SubjectRe: label a scatter plot with non-clashing text labels automatically
Message-ID<d44ae1d2-4143-43a6-b0f0-cec175b8d23c@googlegroups.com>
On Sunday, 24 February 2008 19:41:44 UTC+1, Rahul  wrote:
> > I know of several algorithms to do this, but it seems a rather
> > specialized requirement.  Probably it would be better to run it as
> > a separate pass over the input data before feeding the data to
> > gnuplot.   My first thought is to take the original file containing
> > [X Y label] and run it through the overlap-avoidance algorithm
> > to produce a new file with extra columns Xnew Ynew.  Then you
> > would plot in 3 passes:
> 
> That is a very good solution for me. Thanks! I think I'll go that way.
> Do you know of any libraries that might have these overlap-avoidance-
> routines implemented? (MATLAB / perl /python / R / C....anything at
> all?)  If possible I would like to avoid reinventing the
> wheel.........In case you had some code-snippets / pseudocode or refs.
> I'd be glad to have them before I re-start from scratch.
> 
> I'm not shooting for a 100% successful, watertight algo; just
> something that works "most" of the time for me. Even partial success
> is better than my existing labor-intensive mess. I can always resolve
> a few label-overlaps manually if  can have a quick-n-dirty script do
> better than the raw overlapped mess gnulot spews out right now. If any
> fellow-gnuplot-users know of any time-saving hacks they can think of
> (as opposed to the rigorous algorithms ) I'd appreciate the ideas too!
> 
> > Yes. PostScript devices will use the exact font you ask for if they
> > have it, otherwise they will substitute something else.
> 
> Right. I was assuming we use a "standard" font. Arial, TNR, Hevletica,
> Courier: something that the postcript printer has. (if not, one can
> usually embed a font, right?) In this case we can be sure a priori
> EXACTLY how large the font will be on the printed page, I guess.
> 
> -Rahul

Hi, I'm from the future! Try this:

https://github.com/Phlya/adjustText/blob/master/examples/Examples.ipynb

Fran

PS. https://xkcd.com/979/

[toc] | [next] | [standalone]


#3778

FromGavin Buxton <gavinbuxton@gmail.com>
Date2017-10-15 08:56 -0700
Message-ID<3e39320c-6e1e-4ae2-bfe3-790e2c33694e@googlegroups.com>
In reply to#3776
Hi

Do you need all points labeled? Would plotting all points first and then plotting only every other label work? Something like: 

plot 'data.dat' u 1:2 w p, '' every 2 u 1:2:3 with labels

I really like some of the other answers though!


Gavin

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web