bugGNU Octave - Bugs: bug #66796, contour producing numerous small...

 
 

bug #66796: contour producing numerous small lines for single contour

Submitter:  None
Submitted:  Fri 14 Feb 2025 04:53:07 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  pa23 Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 9.4.0
Release:  Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 14 Feb 2025 06:27:05 PM UTC, comment #2: 

looking at the content, the LabelSpacing parameter isn't relevant, the same result occurs if it is left out. 

looking at the contour plot, the issue seems to be that the two curves with dense labels are actually a large number of short segment curves. the plot actually contains ~40 individual lines.  one line each for the 5 lines with 'normal' labels, the right half of the bigger z=200 curve is a single line, the left half of that curve is actually about 26 individual segments, each with its own label.  the small curve is similar, with about 7 curves for that one. 

you can view this by running the following after running the OP's testcont.m script:


hold off
figure
xlim ([900 2600]);ylim ([0 700]);
hold on

for idx = 1:numel(get(h, 'children'));
  plot(get(get(h, 'children')(idx), "xdata"), get(get(h, 'children')(idx), "ydata"));
  disp(idx);
  disp("press a key");
  pause;
endfor


retitling report as the problem isn't related specifically to the labels.  not sure if there's an existing report on this.


Nicholas Jankowski <nrjank>
Group Member
Fri 14 Feb 2025 05:23:08 PM UTC, comment #1: 

confirmed with recent stable build and compared with matlab, something is off with the label.  see attached comparison showing excessive text labels on top curve, whereas labeling seems 'normal' in matlab using the same script.  (only changed # to % in script to run in matlab)




Nicholas Jankowski <nrjank>
Group Member
Fri 14 Feb 2025 04:53:07 PM UTC, original submission:  

When creating contour plots, function clabel sometimes produces unwanted, unnecessary labels. The attached files contain script and result image.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56891:  ContourLabelsMatlabOctaveCompare.PNG added by nrjank (70KiB - image/png - Octave - matlab contour plot comparison)
file #56889:  testcont.m added by None (4KiB - text/x-objcsrc)
file #56890:  res.png added by None (34KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Updated the item)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-02-14 nrjank SummaryUnwanted unnecessary labels on contour lines contour producing numerous small lines for single contour
    2025-02-14 nrjank Attached File- Added ContourLabelsMatlabOctaveCompare.PNG, #56891
        Item GroupInaccurate Result Incorrect Result
        StatusNone Confirmed
        Operating SystemGNU/Linux Any
    2025-02-14 None Attached File- Added testcont.m, #56889
        Attached File- Added res.png, #56890

    Back to the top

    Powered by Savane 3.14-7003.
    Corresponding source code