Skip to content

Commit d42d495

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 6d66ef8 commit d42d495

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
@@ -588,8 +588,11 @@ sub draw {
588588
my $function = $data->function_string($f->{Fy}, 'PGF', $f->{xvar});
589589
if ($function ne '') {
590590
$data->update_min_max;
591+
my ($axes_xmin, undef, $axes_xmax) = $plots->axes->bounds;
592+
my $min = $data->style('continue') || $data->style('continue_left') ? $axes_xmin : $f->{xmin};
593+
my $max = $data->style('continue') || $data->style('continue_right') ? $axes_xmax : $f->{xmax};
591594
$plot_options .= ", data cs=polar" if $data->style('polar');
592-
$plot_options .= ", domain=$f->{xmin}:$f->{xmax}, samples=$f->{xsteps}";
595+
$plot_options .= ", domain=$min:$max, samples=$f->{xsteps}";
593596
$plot = "{$function}";
594597
}
595598
} else {

0 commit comments

Comments
 (0)