Skip to content

Commit 08f2034

Browse files
committed
Implement the continue, continue_left, and continue_right options in the TikZ format.
This was an inconsistency between the two formats. Basically, the JSXGraph format did not honor the function max if `continue` or `continue_right` was set, but the TikZ format did. This could result in a function graph continuing to the right in the JSXGraph format, but not in the TikZ format (assuming the board bounds go further to the right). This just makes the TikZ output use the axes max instead of the function max in this case. Of course if `continue` and `continue_left` are set then the axes min is used instead of the function min.
1 parent 96735e5 commit 08f2034

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Plots/Tikz.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,11 @@ sub draw {
589589
my $function = $data->function_string($f->{Fy}, 'PGF', $f->{xvar});
590590
if ($function ne '') {
591591
$data->update_min_max;
592+
my ($axes_xmin, undef, $axes_xmax) = $plots->axes->bounds;
593+
my $min = $data->style('continue') || $data->style('continue_left') ? $axes_xmin : $f->{xmin};
594+
my $max = $data->style('continue') || $data->style('continue_right') ? $axes_xmax : $f->{xmax};
592595
$plot_options .= ", data cs=polar" if $data->style('polar');
593-
$plot_options .= ", domain=$f->{xmin}:$f->{xmax}, samples=$f->{xsteps}";
596+
$plot_options .= ", domain=$min:$max, samples=$f->{xsteps}";
594597
$plot = "{$function}";
595598
}
596599
} else {

0 commit comments

Comments
 (0)