Skip to content

Disable RDP smoothing for JSXGraph function graphs. - #1569

Merged
somiaj merged 1 commit into
openwebwork:developfrom
drgrice1:plots-fill-issue
Nov 12, 2026
Merged

somiaj merged 1 commit into
openwebwork:developfrom
drgrice1:plots-fill-issue

Conversation

@drgrice1

@drgrice1 drgrice1 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

JSXGraph 1.13.0 enables RDPsmoothing by default for functiongraph elements. That thins out the curve points, and since the fill code filters those points to the fill_min/fill_max range, the fill no longer starts at fill_min (or ends at fill_max), leaving a visible gap.

The following MWE can be used to test this.

DOCUMENT();

loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl');

$graph = Plot(xmin => -4, xmax => 4, ymin => 0, ymax => 0.42);
$graph->add_dataset([ [ -1, 0 ], [ -1, exp(-1 / 2) / sqrt(2 * pi) ] ]);
$graph->add_function([
    'exp(-x^2 / 2) / sqrt(2 * pi)', 'x', -4, 4,
    name     => 'f',
    fill     => 'xaxis',
    fill_min => -1,
    fill_max =>  4,
    #jsx_options => { RDPsmoothing => 0 }
]);

BEGIN_PGML
[!graph!]{$graph}
END_PGML

ENDDOCUMENT();

With the develop branch (or the main branch) there is a visible gap on the left side of the fill region. If the commented out line in that code is uncommented, the gap goes away with the develop branch. With this branch the macro adds that option, so the gap also is gone.

@pstaabp

pstaabp commented Nov 2, 2026

Copy link
Copy Markdown
Member

I'm not seeing a gap on develop. Here's what I'm seeing:

image

@drgrice1

drgrice1 commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

Are you sure that you have the line #jsx_options => { RDPsmoothing => 0 } commented out? I see
gap
with that line commented out. If I uncomment that line or use this pull request, then the gap goes away.

@drgrice1

drgrice1 commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

That happens with the main branch as well by the way.

@pstaabp pstaabp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not seeing it on develop, but am on main and this is pretty straightforward.

JSXGraph 1.13.0 enables RDPsmoothing by default for functiongraph
elements.  That thins out the curve points, and since the fill code
filters those points to the fill_min/fill_max range, the fill no longer
starts at fill_min (or ends at fill_max), leaving a visible gap.

The following MWE can be used to test this.

```
DOCUMENT();

loadMacros('PGstandard.pl', 'PGML.pl', 'plots.pl', 'PGcourse.pl');

$graph = Plot(xmin => -4, xmax => 4, ymin => 0, ymax => 0.42);
$graph->add_dataset([ [ -1, 0 ], [ -1, exp(-1 / 2) / sqrt(2 * pi) ] ]);
$graph->add_function([
    'exp(-x^2 / 2) / sqrt(2 * pi)', 'x', -4, 4,
    name     => 'f',
    fill     => 'xaxis',
    fill_min => -1,
    fill_max =>  4,
    #jsx_options => { RDPsmoothing => 0 }
]);

BEGIN_PGML
[!graph!]{$graph}
END_PGML

ENDDOCUMENT();
```

With the develop branch (or the main branch) there is a visible gap on
the left side of the fill region.  If the commented out line in that
code is uncommented, the gap goes away with the develop branch.  With
this branch the macro adds that option, so the gap also is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@somiaj
somiaj merged commit f9966fd into openwebwork:develop Nov 12, 2026
4 checks passed
@drgrice1
drgrice1 deleted the plots-fill-issue branch November 12, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants