setting SVG viewbox to auto-calculated margins

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

setting SVG viewbox to auto-calculated margins

Grothausmann, Roman Dr.
Dear mailing list members,


Is there any way to set the SVG viewbox to the auto-calculated margins after
plotting?
Or any other way to get an SVG with all margins set to 0 BUT not losing
everything outside the margins like annotations?
I tried:

set terminal svg
set lmargin 0
set rmargin 0
set tmargin 0
set bmargin 0
set xlabel "test"

but the output SVG does not contain any text/elements outside the margins.
When not setting the margins to 0, and adjusting the viewbox of the SVG
afterwards (with the border coords found via inkscape) works, but I can't find a
way to get the auto-computed margin values to e.g. create a sed-command that
adjusts the viewbox accordingly after gnuplot finished.

I checked
show variables all
for variables containing fitting values. GPVAL_TERM_XMIN fits viewbox-x and
GPVAL_TERM_XMAX-GPVAL_TERM_XMIN fits viewbox-width;
GPVAL_TERM_YMAX-GPVAL_TERM_YMIN fits viewbox-height but GPVAL_TERM_YMIN does NOT
fit viewbox-y.
I could find no other value in the list that would fit or allow to calculate the
correct value for viewbox-y as later found via inkscape.

Any help or hints are very much appreciated
Roman

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting SVG viewbox to auto-calculated margins

Grothausmann, Roman Dr.
On 24/06/16 09:57, Grothausmann, Roman Dr. wrote:
> I checked
> show variables all
> for variables containing fitting values. GPVAL_TERM_XMIN fits viewbox-x and
> GPVAL_TERM_XMAX-GPVAL_TERM_XMIN fits viewbox-width;
> GPVAL_TERM_YMAX-GPVAL_TERM_YMIN fits viewbox-height but GPVAL_TERM_YMIN does NOT
> fit viewbox-y.

Found that these values do the trick:

GPVAL_TERM_XMIN
GPVAL_TERM_YSIZE / GPVAL_TERM_SCALE - GPVAL_TERM_YMAX
GPVAL_TERM_XMAX - GPVAL_TERM_XMIN
GPVAL_TERM_YMAX - GPVAL_TERM_YMIN

The problem was that SVG y-direction is down while gnuplot's y-direction is up.

> Any help or hints are very much appreciated
> Roman
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> gnuplot-info mailing list
> [hidden email]
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>

--
Dr. Roman Grothausmann

Tomographie und Digitale Bildverarbeitung
Tomography and Digital Image Analysis

Institut für Funktionelle und Angewandte Anatomie, OE 4120
Medizinische Hochschule Hannover
Carl-Neuberg-Str. 1
D-30625 Hannover

Tel. +49 511 532-2900

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Loading...