bugGNU Octave - Bugs: bug #48208, "markersize"...

 
 

bug #48208: "markersize" compatibility

Submitted by:  Dmitri A. Sergatskov <dasergatskov>
Submitted on:  Mon 13 Jun 2016 03:34:34 AM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Dmitri A. SergatskovOpen/Closed: Closed
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)

Mon 20 Jun 2016 06:57:52 PM UTC, comment #10:

I think it is worth running the examples from comment #5 to determine exact Matlab behavior.

I made the '.' marker one-third of the MarkerSize property for Matlab compatibility in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/da9127ba1e0a). This applies only to the OpenGL toolkits, but apparently gnuplot was already doing this correctly.

Rik <rik5>
Project Administrator
Mon 20 Jun 2016 04:58:56 PM UTC, comment #9:

@Dmitri: You're right that it may be the OpenGL renderer. Small markersizes do not display on my screen, but are present in the output if I use print.

Rik <rik5>
Project Administrator
Wed 15 Jun 2016 06:45:14 PM UTC, comment #8:

> At the moment,
> h = plot (0.5, 0.5, '.', 'markersize', 1)
> produces a blank plot.


Works for me.
Did you try to make a hardcopy or just looked at the screen?
It could be issue with renderer.
I noticed that on different hardware gl plots look different.

Dmitri.

Dmitri A. Sergatskov <dasergatskov>
Wed 15 Jun 2016 06:26:04 PM UTC, comment #7:

@Dmitri: Good digging through the documentation to find that specification. I think Octave must have it wrong then. For a circle the calculation is sz/2 and for a dot we use sz/3. The older Matlab docs suggest we should really be using

for the dot size. I think we also need to specify a minimum for the computed size of at least one pixel. At the moment,

produces a blank plot. I need to use

before I can see anything. I would still be interested in the table of markersizes to see if they are using a different sizing algorithm for the smaller markersizes versus the large ones.

Rik <rik5>
Project Administrator
Wed 15 Jun 2016 05:19:04 PM UTC, comment #6:

(Somehow my comments did not show up -- sorry if this is a duplicate).

In older version of Matlab's doc they say explicitly that size of the dot is 1/3 of specified size. See e.g.:

http://www-rohan.sdsu.edu/doc/matlab/techdoc/ref/line_props.html

Dmitri A. Sergatskov <dasergatskov>
Wed 15 Jun 2016 04:33:57 PM UTC, comment #5:

Thanks everyone for testing. The supposed behavior for a primitive line object is found at http://www.mathworks.com/help/matlab/ref/primitiveline-properties.html.

I mispelled the attribute 'markeredgecolor' which is why this error resulted.

That's okay though. I get the gist, which is that for '.' the 'Color' attribute is used, unless 'markeredgecolor' has been specified to a different value than 'auto'. So Octave is okay in that respect.

But I don't understand the sizings. According to the documentation the sizing is done in points (basically 1/72 of an inch). So for a screen resolution of 90 ppi I would expect some relation to the quantity

In gl-render.cc I see the following code for the marker size.

and later

But also,

So, for the 'o' marker everything makes sense. The size (diameter) is determined in points. And the draw routine uses diameter/2, or the radius, to construct the 'o'. But the dot marker is special. It is using diameter/3 for the radius.
@Lachlan: Could you run tests in Matlab to try and determine what is going on? I think we need to construct a table of marker size versus resulting pixel size on screen.

Possible code, with measurement after each run:

And then repeated with the 'o' marker.

At the large sizes, like 72, it is clear that Octave is actually drawing 10-sided decagons, rather than smooth circles. Does Matlab do this to or do they scale the number of vertices in the OpenGL polygon to make it appear smooth at all sizes?

Rik <rik5>
Project Administrator
Wed 15 Jun 2016 11:10:09 AM UTC, comment #4:

I got

set (h, 'markeredgecolor', 'g') % does dot change to 'green'
Yes.

The previous ones are the same.

get (0, 'screenpixelsperinch') % Current resolution
ans = 120

Anonymous
Wed 15 Jun 2016 07:36:14 AM UTC, comment #3:

get (h, 'markersize') % What is default
ans = 6

get (h, 'markerfacecolor') % What is default (blue, or something else)
ans = none

get (h, 'markeredegcolor') % What is default (blue, or something else)
Error using graph2d.lineseries/get
The name 'markeredegcolor' is not an accessible property for an instance of class
'lineseries'.

set (h, 'markerfacecolor', 'm') % does dot change to 'magenta'
No

set (h, 'markeredgecolor', 'g') % does dot change to 'green'
No

%% Secondary test for markersize compatibility.
get (0, 'screenpixelsperinch') % Current resolution
ans = 90

set (h, 'markersize', 4) % what is size of marker in pixels on screen?
one (Yes, one.)

set (h, 'markersize', 16) % what is size of marker in pixels on screen?
It looks like a 5x5 square with two extra pixels

set (h, 'markersize', 36) % what is size of marker in pixels on screen?
It looks like a circle of about 14 pixels diameter.

Lachlan Andrew <lachlan>
Project Member
Tue 14 Jun 2016 03:56:26 PM UTC, comment #2:

To be clear, can somebody run the following in Matlab and report back.

I'll re-post to the Octave-Maintainer's list.

Rik <rik5>
Project Administrator
Mon 13 Jun 2016 04:37:16 AM UTC, comment #1:

The issue is particular to the dot '.' marker. Try using a different marker to see it working.

I know there is special code in gl-render.cc for the '.' marker. How does Matlab handle this? Is '.', really equivalent to a circle (marker 'o') but with a reduced radius? We need to know what behavior we should be aiming for.

Rik <rik5>
Project Administrator
Mon 13 Jun 2016 03:34:34 AM UTC, original submission:

plot(randn(3), ".y", "markersize", 24, "markeredgecolor", "k")

makes symbol color black (rather than making black border).

(both dev and 4.0.2 are affected)

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by dasergatskov (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 03 Nov 2016 11:53:41 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 15 Jun 2016 04:33:57 PM UTCrik5Item GroupInaccurate Result=>Matlab Compatibility
      Summary"markeredgecolor" changes symbol color instead when symbol is '.'=>"markersize" compatibility
    Mon 13 Jun 2016 04:37:16 AM UTCrik5StatusNone=>Confirmed
      Summary"markeredgecolor" changes symbol color instead=>"markeredgecolor" changes symbol color instead when symbol is '.'

    Back to the top


    Powered by Savane 3.1-cleanup1