bug-plotutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-plotutils] graph: issue with title: in certain cases not render


From: Stefan Vargyas
Subject: Re: [Bug-plotutils] graph: issue with title: in certain cases not rendered at all
Date: Sun, 30 Oct 2016 09:23:05 -0700

Dear Robert,

In the mean time I found the reason of existence of the 'if'
statement in 'graph/plotter.c:draw_frame_of_graph' as it is:

  if (multigrapher->grid_spec != NO_AXES
      && !multigrapher->y_axis.switch_axis_end /* no title if x axis is at top 
of plot */
      && multigrapher->title != NULL && *multigrapher->title != '\0')

The condition '!multigrapher->y_axis.switch_axis_end' avoids
that certain plots -- e.g. that in '3.png' attached -- render
tick labels and the abscissa label over the title, if given.

However, the respective condition is *too restrictive*, as it
does not allow titles to be rendered in plots like '2.png' of
my previous email.

The patch attached addresses the situation described somehow
ungracefully: it introduces `--force-top-label' command line
option to 'graph' for to percolate it down to the level of the
'if' above as parameter 'multigrapher->force_title'.

Hope this will help others encountering this issue.

Sincerely,

Stefan Vargyas.


PS: The command generating '3.png' out of '3.txt' is:

  $ gen-png() {
  graph \
  --toggle-use-color \
  --toggle-frame-on-top \
  --toggle-log-axis=x \
  --output-format png \
  --page-size a4 \
  --symbol 4 .02 \
  --font-name HersheySans-Bold \
  --font-size .038 \
  --grid-style 4 \
  --tick-size -.01 \
  --title-font-size .05 \
  --bitmap-size 2732x2732 \
  --height-of-plot .7 \
  --width-of-plot .7 \
  --line-width .001 \
  --top-label 'path trie total mem' \
  --x-label path-names \
  --y-label percents "$@"|
  convert - -resize 500x500 -; }

  $ gen-png --force-top-label 3.txt > 3.png


Attachment: graph-force-top-label.patch
Description: Binary data

Attachment: 3.txt
Description: Text document

Attachment: 3.png
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]