#224 Background in SVG

closed-works-for-me
nobody
None
5
2008-11-10
2008-11-03
Petr Písař
No

Plotted SVG has no background even if some parts of graph are painted with explicit color.

This differs from PNG output where the background is plotted.

(Note that both formats support transparency.)

Picking up any foreground color without knowing background can lead into unreadable image.

OTOH, there can be valid use cases when we suppose light/dark enough background with carefully selected painting colors making acceptable contrast. (This allows e.g. custom background add in postprocessing.)

The superior SVG supports so called `currentColor'. Thus proper usage of currentColor foreground and undefined/unfilled background can produce totally color independent pictures.

So I suggest:

* gnuplot should provide option to drive not-plotting explicit background.

* gnuplot could provide option to produce color independent pictures by rigorous usage of currentColor and avoidance of other colors.

Discussion

  • Ethan Merritt
    Ethan Merritt
    2008-11-04

    • labels: 102067 -->
     
  • Ethan Merritt
    Ethan Merritt
    2008-11-04

    * gnuplot should provide option to drive not-plotting explicit background.

    This is what the current svg driver does. It draws no backgound (effectively equivalent to PostScript, pdf or to 'set term png transparent').

    If you want to force a background color, you can use
    set object rectangle from screen 0,0 to screen 1,1 rc rgb "white"

    * gnuplot could provide option to produce color independent pictures by
    rigorous usage of currentColor and avoidance of other colors.

    This is an interesting idea, although I warn you that many of the current generation of svg viewers do not handle currentColor correctly. In fact, gnuplot's svg driver originally made more use of currentColor but we changed it because so many of the viewers were broken.

    [moving this to Feature Requests]

     
  • Petr Písař
    Petr Písař
    2008-11-04

    * gnuplot should provide option to drive not-plotting explicit background.

    This is what the current svg driver does.

    I wanted to write not/plotting (i.e plotting---not-plotting).

    set term png transparent
    set object rectangle from screen 0,0 to screen 1,1 rc rgb "white"

    I see. The same effect is caused on different levels. Than my request for unified way how to draw background loses sense.

    So I think you can close this bug.

     
  • Ethan Merritt
    Ethan Merritt
    2008-11-10

    • status: open --> closed-works-for-me