bugGNU Octave - Bugs: bug #52272, quiver arrowhead too large

 
 

bug #52272: quiver arrowhead too large

Submitted by:  Muhali <muhali>
Submitted on:  Tue 24 Oct 2017 08:49:55 AM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Need InfoAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 10 Nov 2017 12:02:37 PM UTC, comment #16:

I've attached requested output

(file #42360, file #42361)

Richard <crobar>
Fri 10 Nov 2017 01:41:59 AM UTC, comment #15:

I've also fixed the issue where the arrowshaft was not scaled when there was just a single vector.

Rik <rik5>
Project Administrator
Fri 10 Nov 2017 01:40:12 AM UTC, comment #14:

I now have the arrowshaft and the angle that the arrowheads make with the arrowshaft correct, but I still can't figure out the algorithm that Matlab is using for the size of the arrowhead. New test code for Matlab is:

Rik <rik5>
Project Administrator
Thu 09 Nov 2017 04:47:08 PM UTC, comment #13:

I can't move forward until I see the results from Matlab for the code in comment #12.

Rik <rik5>
Project Administrator
Sun 05 Nov 2017 05:44:41 AM UTC, comment #12:

Actually, a better test case to run would be

Rik <rik5>
Project Administrator
Thu 26 Oct 2017 04:08:51 PM UTC, comment #11:

@Richard: Could you try this code?

This should produce a very clean test case without any sqrt(2) factors obscuring the algorithm.

Rik <rik5>
Project Administrator
Thu 26 Oct 2017 03:41:23 PM UTC, comment #10:

Thanks. It looks like Octave is correctly calculating the length of the arrowshaft, but the arrowhead is too big. At least that points towards which part of the algorithm in _quiver_.m needs modification.

Rik <rik5>
Project Administrator
Thu 26 Oct 2017 03:19:14 PM UTC, comment #9:

See uploaded file tstquiver2.png

(file #42272)

Richard <crobar>
Thu 26 Oct 2017 03:16:03 PM UTC, comment #8:

Could someone with Matlab try this code?

According to the documentation for AutoScale

The idea I'm trying to check is whether AutoScale has a specific case for a single arrow (for which there is no grid).

Rik <rik5>
Project Administrator
Thu 26 Oct 2017 07:23:31 AM UTC, comment #7:

I would guess arrowhead size is proportional to the vector length when only drawing one arrow. See the MaxHeadSize property, defined as "Maximum size of arrowhead, specified as a scalar value in units relative to the length of the arrow."

Richard <crobar>
Thu 26 Oct 2017 06:48:26 AM UTC, comment #6:

@Rik:

(file #42263)

Marco Caliari <caliari>
Project Member
Thu 26 Oct 2017 04:26:22 AM UTC, comment #5:

Here is the Quiver Properties:

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 26 Oct 2017 04:25:16 AM UTC, comment #4:

Changing category back to "Need Info".

@Clark: Can you start Matlab without any user customizations and see if you get the same size figure?

@Dmitri: It could also be the case that Matlab has special logic for weird corner cases such as this one.

Rik <rik5>
Project Administrator
Thu 26 Oct 2017 04:17:49 AM UTC, comment #3:

If I try an example from the matlab documentation
https://www.mathworks.com/help/matlab/ref/quiver.html

I get pretty much an identical figure. I think we want a second opinion... Perhaps Clark Dunson has some custom settings?!

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 26 Oct 2017 03:38:07 AM UTC, comment #2:

Marking as confirmed. The attached jpg from Matlab shows a much smaller arrowhead.

Rik <rik5>
Project Administrator
Tue 24 Oct 2017 04:12:25 PM UTC, comment #1:

What does Matlab do? Could someone run the sample code and upload the image that it produces?

For Octave, the arrowhead size is calculated at about 20% of the size of the grid. Since your grid is 1x1 this comes out to about 0.2. That looks big when the axes limits are tight in around the object, but looks okay when the view is larger. Try

Rik <rik5>
Project Administrator
Tue 24 Oct 2017 08:49:55 AM UTC, original submission:

Using a simple

quiver(5, 5, 1, 1)

produces an arrow whose head is too large.

Muhali <muhali>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #42360:  tstquiver4a.png added by crobar (19KiB - image/png)
file #42361:  tstquiver4b.png added by crobar (20KiB - image/png)
file #42357:  tstquiver3.png added by muhali (27KiB - image/png - quiver test case 3)
file #42272:  tstquiver2.png added by crobar (16KiB - image/png)
file #42263:  tstquiver.png added by caliari (17KiB - image/png)
file #42262:  quiver.jpg added by clarkman (13KiB - image/jpeg)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by crobar (Posted a comment)
  • -unavailable- added by caliari (Updated the item)
  • -unavailable- added by dasergatskov (Posted a comment)
  • -unavailable- added by clarkman (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by muhali (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 10 Nov 2017 12:02:37 PM UTCcrobarAttached File-=>Added tstquiver4a.png, #42360
      Attached File-=>Added tstquiver4b.png, #42361
    Thu 09 Nov 2017 05:27:43 PM UTCmuhaliAttached File-=>Added tstquiver3.png, #42357
    Thu 26 Oct 2017 03:19:14 PM UTCcrobarAttached File-=>Added tstquiver2.png, #42272
    Thu 26 Oct 2017 06:48:26 AM UTCcaliariAttached File-=>Added tstquiver.png, #42263
    Thu 26 Oct 2017 04:25:16 AM UTCrik5StatusConfirmed=>Need Info
    Thu 26 Oct 2017 03:38:07 AM UTCrik5Item GroupNone=>Matlab Compatibility
      StatusNeed Info=>Confirmed
    Thu 26 Oct 2017 01:03:52 AM UTCclarkmanAttached File-=>Added quiver.jpg, #42262
    Tue 24 Oct 2017 04:12:25 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1