X-Received: by 10.107.17.87 with SMTP id z84mr5157753ioi.51.1508059858777; Sun, 15 Oct 2017 02:30:58 -0700 (PDT) X-Received: by 10.157.54.53 with SMTP id w50mr229743otb.2.1508059858746; Sun, 15 Oct 2017 02:30:58 -0700 (PDT) Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!l196no1495183itl.0!news-out.google.com!194ni2673itf.0!nntp.google.com!l196no1495178itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.graphics.apps.gnuplot Date: Sun, 15 Oct 2017 02:30:58 -0700 (PDT) In-Reply-To: <26548b34-97c3-441b-a5a5-1ca05754f7e5@o77g2000hsf.googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=79.134.86.179; posting-account=Q3Wp-goAAADCOguoKz0yGKto8rcG0T3u NNTP-Posting-Host: 79.134.86.179 References: <7315456a-1c46-4d21-a6d2-d6787dc89187@e6g2000prf.googlegroups.com> <26548b34-97c3-441b-a5a5-1ca05754f7e5@o77g2000hsf.googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: label a scatter plot with non-clashing text labels automatically From: francis.tyers@gmail.com Injection-Date: Sun, 15 Oct 2017 09:30:58 +0000 Content-Type: text/plain; charset="UTF-8" Lines: 40 Xref: csiph.com comp.graphics.apps.gnuplot:3776 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/