Infinite loop in pgfplots when starting and ending values of domain are equal

Aperta
#1,326 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
latex, perl

Direzione di ricerca

Start with the add_function method in the plots.pl macro library, which generates the pgfplots domain=2:2 option that makes LaTeX loop. Reproduce with the MWE from the issue and inspect the attached pgfplots.txt around line 76 for the runaway loop. Done means either the equal-bounds case no longer hangs or the code rejects it with a clear error, and the maintainers have settled which. Reversed bounds are a separate question raised in the issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The following MWE leads to LaTeX running away when generating a hardcopy.

DOCUMENT();

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

$plot = Plot();

$plot->add_function('x', 'x', 2, 2);

BEGIN_PGML
>>[!!]{$plot}{400}<<
END_PGML

ENDDOCUMENT();

I have attached a copy of the .tex file that this generates to produce the graph. LaTeX reports "TeX capacity exceeded" on line 76. It looks like the domain=2:2 option is causing an infinite loop.

This appears to be a bug in pgfplots if the domain starts and ends at the same point. Should we be protecting against this?

A related note: both JSXGraph and pgfplots are okay with the domain being expressed in the wrong order (i.e. $plot->add_function('x','x',2,1); draws the graph from 1 to 2. Is there any reason to try and prevent this?

BTW this arose as I was updating code from an old OPL problem (Library/ASU-topics/setLimitConcepts/3-2-36.pg) where they used this construct to draw a solid circle by plotting a function that started and ended at the same point.

pgfplots.txt

Lingua principale
Perl
Stelle
48
Fork
78
Merge medio
5g 13h
PR unite (30g)
9

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openwebwork/pg

Tutte le issue di openwebwork/pg

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.