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

Đang mở
#1,326 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 4 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
18/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
latex, perl
Lĩnh vực
data-visualization

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Perl
Star
48
Fork
78
Merge trung bình
5 ngày 13 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openwebwork/pg

Tất cả issue của openwebwork/pg

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.