[LON-CAPA-users] gnuplot and option response

Stuart Raeburn raeburn at msu.edu
Tue Dec 2 16:20:50 EST 2014


Hi Hon-Kie,

> The figures are not in the right place for the option selections.

I expect you have already resolved this.

Anyway, I found that eliminating the 'align="left"' string from the  
contents of the $gnuplot scalar assigned in the script block resulted  
in alignment of a select box to the left of each dynamically generated  
gnuplot image for each foil, with the foils themselves stacked  
vertically.

Stuart Raeburn
LON-CAPA Academic Consortium

Quoting "H. K. Ng" <hkng at fsu.edu>:

> Hi,
>
> It seems that images generated using gnuplot do not line up the same way as
> previously generated images. The images are staggered, not like
>
> image - selection
> image - selection
>
> See example below. Anyone knows how to fix this?
>
> Thanks,
> -hk
>
> <problem>
> <script type="loncapa/perl">
> $gnuplot = &plotThis();
>
> sub plotThis {
>
> $gnuplot=<<GNUPLOT;
> <gnuplot width="200" transparent="off" samples="100" grid="on" font="10"
> bgcolor="xffffff" height="200" align="left" fgcolor="x000000" border="on"
> plottype="Cartesian" texwidth="70" fontface="sans-serif" bmargin="4"
> rmargin="1" tmargin="2" lmargin="6" texfont="12">
>     <axis xmin="-5" ymin="-4" xmax="5" ymax="4" color="x000000"
> yzero="thick-line" xzero="line" />
>     <ytics minorfreq="2" location="border" mirror="off" increment="2"
> start="-4" />
>     <xlabel>Label X</xlabel>
>     <ylabel>Label Y</ylabel>
>     <curve linestyle="lines" color="x000000" pointtype="2"
> linetype="dashed" linewidth="1" limit="closed" pointsize="1">
>         <function>sin(x)</function>
>     </curve>
> </gnuplot>
> GNUPLOT
> return $gnuplot;
> }
> </script>
> <startouttext />
> The figures are not in the right place for the option selections.
> <endouttext />
>
> <optionresponse max="600" randomize="no" id="13">
>    <foilgroup options="('Select 1','Select 2','Select 3')">
>       <foil value="Select 1" name="s1">
>          <startouttext /><parse>$gnuplot</parse><endouttext />
>       </foil>
>       <foil value="Select 2" name="s2">
>          <startouttext /><parse>$gnuplot</parse><endouttext />
>       </foil>
>       <foil value="Select 3" name="s3">
>         <startouttext /><parse>$gnuplot</parse><endouttext />
>       </foil>
>       </foilgroup>
> </optionresponse>
>
> </problem>



More information about the LON-CAPA-users mailing list