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


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

Re: Few problems using GnuPlot 5.0 on Mac OS X

From Ethan A Merritt <EAMerritt@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Few problems using GnuPlot 5.0 on Mac OS X
Date 2017-08-21 22:47 -0700
Organization A noiseless patient Spider
Message-ID <ongg9l$3dv$1@dont-email.me> (permalink)
References <cdf9e487-7206-4ac4-a4d1-c732fd2e6c34@googlegroups.com>

Show all headers | View raw


Kevin Buchs wrote:

> I have tried gnuplot for a plotting need in the past, but found the
> overhead for the task I wanted to accomplish way too high. Still, I
> see people touting the application, so today I decided to go all in
> and figure out how to make it do what I wanted. I downloaded the
> source for 5.0.7 and the accompanying manual. I built it on OS X
> 10.12.5 with Gnu toolchain (./configure;make;make install) and took
> off.
> 
> I wanted a vertical bar chart, with text labels overlaying the bars.
> Starting from several examples and the manual, along with a lot of
> hacking, I have what I want, sort of. However, along the way, I found
> numerous items that didn't work as documented. Maybe someone can help
> me determine if this is me, if what I don't know about gnuplot is
> lacking or if there are some opportunities for improvement.
> 
> Here is my script.
> 
> 8><----------------------------------------------------------------------------------
> # I had to amend my data by adding 4th and 5th columns to control the
> # label position and rotation.
> 
> $Data <<EOD
> 1 13 "Abcd NOC Handling" 50 -90
> 2 43 "Abcd T3 Team for SLI" 50 -90
> 3 12 "Abcd BBNOC" 50 -90
> 4 53 "Abcd Efghij Support" 50 -90
> 5 21 "Efghij Response Time" 50 -90
> 6 47 "Efghij replicating problem" 50 -90
> 7 11 "Efghij workaround to staging" 50 -90
> 8 43 "Abcd/Jari verify staging" 50 -90
> 9 86 "Efghij workaround to production" 50 -90
> 10 5 "Abcd confirmation/resolution" 50 -90
> EOD
> 
> set terminal pngcairo transparent enhanced font "arial,10" fontscale
> 1.0 size 500, 350 set title "Time for Major Steps In P1 Resolution"
> set style fill solid 1.0
> set style textbox opaque noborder
> unset key
> set boxwidth 0.75 abs
> set bmargin at screen 0.1
> set tmargin at screen 0.9
> set angle degrees
> unset xtics
> set yrange [0:100]
> set ylabel "Seconds"
> 

> set label right # does not work - seems to be stuck at cente
> # Fails to rotate
> # set label rotate by 90
> # plot $Data using 1:2:3 with labels

"set label" defines a single label; it does not set any sort of default
for future labels.  Since your label command contains neither a label number
nor a text string, it has no effect at all.

What you want, I think, is

    plot $Data using 1:2:3 with labels rotate by 90

See also online demo:

    http://gnuplot.sourceforge.net/demo_5.0/rotate_labels.html

> 
> # like to be able to insert constant values instead of columns 4 and
> # 5, but how?

A using specifier can contain any expression, including a constant expression,
if given in parentheses.  So

    plot $Data using 1:2:3:(4.44):(5.55) ...


 > plot $Data using 1:2 with boxes, '' using 1:4:3:5 with labels rotate
> variable

    Works here.
 
> 
> 
> ## set terminal aqua ## doesn't appear in list but in the manual
> ##                   ## (after I installed the aquaterm application).
> 8><----------------------------------------------------------------------------------
> 
> All my questions/problems are in-line, but just to reiterate
> 1) Right justification for the labels failed to work

You have not shown an example, so I don't know what went wrong.
Maybe the same error you show with rotation? right-justify isn't a default
that you set for future labels, it is a property that must be given as part of
each individual label command (or plot).

> 2) Setting fixed rotation for the labels didn't work

See above.

> 3) Since I needed to specify a fixed y-value for my labels as well as
> their rotation, I thought it would be nice to be able to specify
> constant values instead of having to amend my data, but I could not
> determine how to do this. 

Put the constant in parentheses

> 4) I was seeking a rapid REPL since I tried
> about a thousand variations. I thought maybe the Tkcanvas or aquaterm
> would give me that, but didn't work. Perhaps those have to be
> present/specified at build time. Is there a better REPL?

The aqua terminal is an external program that does not support all
gnuplot commands. I suggest sticking with one of the cairo terminals
until you get the plot working.  Then if you want you can see whether
it also works with the aqua terminal, but no guarantees there.

> BTW, the data above is the extent of what I was working with. I
> probably could have drawn this by hand in a time much shorter than the
> 3 hours I spent on it. Steep learning curve.

Have you looked through the online demo collection?
If you find a plot that looks more or less like you want, you can
use the sample commands as a starting point.

  http://gnuplot.sourceforge.net/demo_5.0/

	Ethan

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


Thread

Few problems using GnuPlot 5.0 on Mac OS X Kevin Buchs <kevin.buchs@gmail.com> - 2017-08-21 15:34 -0700
  Re: Few problems using GnuPlot 5.0 on Mac OS X Ethan A Merritt <EAMerritt@gmail.com> - 2017-08-21 22:47 -0700
    Re: Few problems using GnuPlot 5.0 on Mac OS X Kevin Buchs <kevin.buchs@gmail.com> - 2017-08-22 07:11 -0700
      Re: Few problems using GnuPlot 5.0 on Mac OS X Ethan A Merritt <EAMerritt@gmail.com> - 2017-08-22 09:27 -0700

csiph-web