|
From: Michael S. <Mic...@bo...> - 2021-04-25 10:55:21
|
Is there any reason the native SVG terminal type does not work for you? It
creates interactive plots.
michael@jenkins:~$ gnuplot
G N U P L O T
Version 5.2 patchlevel 6 last modified 2019-01-01
Copyright (C) 1986-1993, 1998, 2004, 2007-2018
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
Terminal type is now 'unknown'
gnuplot> help set term svg
This terminal produces files in the W3C Scalable Vector Graphics format.
Syntax:
set terminal svg {size <x>,<y> {|fixed|dynamic}}
{mouse} {standalone | jsdir <dirname>}
{name <plotname>}
{font "<fontname>{,<fontsize>}"} {{no}enhanced}
{fontscale <multiplier>}
{rounded|butt|square} {solid|dashed} {linewidth
<lw>}
{background <rgb_color>}
where <x> and <y> are the size of the SVG plot to generate,
`dynamic` allows a svg-viewer to resize plot, whereas the default
setting, `fixed`, will request an absolute size.
`linewidth <w>` increases the width of all lines used in the figure
by a factor of <w>.
<font> is the name of the default font to use (default Arial) and
<fontsize> is the font size (in points, default 12). SVG viewing
programs may substitute other fonts when the file is displayed.
The enhanced text mode syntax is shared with other gnuplot terminal types.
See `enhanced` for more details.
The `mouse` option tells gnuplot to add support for mouse tracking and for
toggling individual plots on/off by clicking on the corresponding key
entry.
By default this is done by including a link that points to a script in a
local directory, usually /usr/local/share/gnuplot/<version>/js.
You can change this by using the `jsdir` option to specify either a
different local directory or a general URL. The latter is usually
appropriate if you are embedding the svg into a web page.
Alternatively, the `standalone` option embeds the mousing code in the svg
document itself rather than linking to an external resource.
When an SVG file will be used in conjunction with external files,
e.g. if it is referenced by javascript code in a web page or parent
document,
then a unique name is required to avoid potential conflicting references
to other SVG plots. Use the `name` option to ensure uniqueness.
On Thu, Apr 22, 2021 at 4:21 PM Jeff Nova via gnuplot-info <
gnu...@li...> wrote:
> We have a bash script that uses gnuplot via its CLI to output simple
> histograms in GIF format. We would like to change that output in SVG or
> HTML5 format, so there is mouse interactivity. We're hoping to just hire
> someone to knock this out for us! But if no one is interested, any
> guidance would be appreciated.
>
> Here's an example of the code:
>
> /usr/local/bin/gnuplot << EOF
> # set terminal size and background color and medium font size
> set terminal gif medium size $width,$height background rgb "$bgcolor"
> unset key
> unset tics
> unset border
> set bmargin 0
> set lmargin 0
> set rmargin 0
> set tmargin 0
> set output "${outdir}/${inname}_histogram_${colormode}.gif"
> set xrange [0:255]
> set yrange [0:$ymax]
> plot "tmpT.txt" using 1:2 with filledcurves below x1 linecolor
> "$linecolor"
> # EOF must not have any white space before it or does not work
> EOF
>
>
> --
> Jeff NovaChief Executive Officer
> Colorhythmhttps://colorhythm.com
> jn...@co...
> Main: +1 415-399-9921Direct: +1 415-399-9921 x407Mobile: +1
> 510-710-9590Fax: +1 415-399-9928
> Pronouns: he / his
> This electronic mail and the documents accompanying it are considered
> trade secret, confidential and/or proprietary by Colorhythm LLC. This
> information is intended for use by the individual or entity to whom this
> e-mail is addressed. If you are not the intended recipient, be aware that
> any disclosure, copying, distribution or use of the contents of this
> information is prohibited.
>
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
|