bugGNU Octave - Bugs: bug #61350, Marker Symbol 'I' and '_' not...

 
 

bug #61350: Marker Symbol 'I' and '_' not available in plot

Submitter:  None
Submitted:  Mon 18 Oct 2021 10:19:38 PM UTC
   
 
Category:  Plotting Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Zhaxi Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 12 Nov 2021 06:42:22 PM UTC, comment #9: 

Thanks, the change looks good to me.  I pushed the following additional doc fix for plot:

http://hg.savannah.gnu.org/hgweb/octave/rev/4aa5b391f0d3

Closing as fixed.

John W. Eaton <jwe>
Group administrator
Wed 27 Oct 2021 11:08:33 PM UTC, comment #8: 

I tracked it down to the constructor for radio_values which needed a special case to decode "|||" and result in a value of '|'.  This seems to work just fine and "set (h, 'property_name')" works correctly as well.  The documentation picks up the change nicely too so that '|' is listed as a possible marker style.  I checked things in here: http://hg.savannah.gnu.org/hgweb/octave/rev/20fd3c03fd74.

Marking as Ready for Test.

Rik <rik5>
Group administrator
Wed 27 Oct 2021 09:48:26 PM UTC, comment #7: 


> Is that use of the pipe character visible to users (other than in the output of things like "set (gcf)") or is it only internal to the code for defining possible property values in graphics.cc?


As you noted it is used in "set (handle_to_graphics_object)".  I thought it was also used in generating our documentation (genpropdoc.m), but it turns out that we use the form "s = set (h)" so we get a struct back and then use fieldnames() to find the list of properties for an object.

In tracing I got as far as graphics-props.cc.  This is C++ code and the message I get is


libinterp/corefcn/graphics-props.cc:3083:29: warning: unknown escape sequence: '\|'
     m_marker ("marker", mh, "{none}|+|o|*|.|x|\||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram"),


If I use "|||" to indicate a '|' between other options then '|' doesn't show up in the possible options.  I know that somewhere there must be a routine that parses this possible options string; I just haven't located it yet.

Rik <rik5>
Group administrator
  Spam posted by _279674
Wed 27 Oct 2021 05:15:10 PM UTC, comment #5: 

Is that use of the pipe character visible to users (other than in the output of things like "set (gcf)") or is it only internal to the code for defining possible property values in graphics.cc?

John W. Eaton <jwe>
Group administrator
Wed 27 Oct 2021 04:14:45 PM UTC, comment #4: 

Attached is a partial changeset that works for '_' and almost works for '|'.

The issue is that Octave uses the pipe character '|' internally in option strings to distinguish between alternatives.  It's not immediately clear where the code needs to be changed so that option processing can recognize an escaped '\|' pipe character.

Anyways, I'm attaching the rough changeset.

(file #52162)

Rik <rik5>
Group administrator
Wed 27 Oct 2021 02:43:45 PM UTC, comment #3: 

I wrote a comment about this earlier but it seems not to have been recorded.  This is a relatively easy change to make.

The function make_marker_list in gl-render.cc would need to be updated with code to draw these two markers.  And the file graphics.in.h which describes the properties of each graphics object would need to be updated so that each "marker" property also accepted '|' and '_'.

Rik <rik5>
Group administrator
Wed 20 Oct 2021 07:53:15 AM UTC, comment #2: 

and similarly for horizontal line markers with "_" as symbol

A.R. Burgers <arb>
Tue 19 Oct 2021 06:50:28 AM UTC, comment #1: 

I changed the category to "feature request" and the severity to 1.

Pantxo Diribarne <pantxo>
Group Member
Mon 18 Oct 2021 10:19:38 PM UTC, original submission:  

When I make a scatter plot by using "|" as a symbol,as shown in attached figure, I find no way to deal with it.
This problem has been solved in matlab 20b version as mentioned in https://de.mathworks.com/help/releases/R2020b/matlab/release-notes.html?category=graphics&rntext=marker&startrelease=R2015b&endrelease=R2020b&groupby=release&sortby=descending.

There is a way to achieve this function by using text() as shown in followed codes:

x = 1:50;
y = rand(size(x));

figure
plot(x, y, '.', 'Color','none')
axis([0  50    0  1])
text(x, y, '|', 'VerticalAlignment','middle', 'HorizontalAlignment','center', 'Color','r')

citation: https://de.mathworks.com/matlabcentral/answers/638790-marker-symbol-i-in-plot

However, if the data is large, this will take long time to run the program.
Can this function be added in the Marker type list?

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #52162:  new_markers.cset added by rik5 (6KiB - application/octet-stream)
file #52121:  Figure@plotted@by@symbol@of@vertical@line.jpg added by None (48KiB - image/jpeg - screen shots)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by _279674 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by arb (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-12 jwe StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-10-27 rik5 StatusConfirmed Ready For Test
    2021-10-27 rik5 Attached File- Added new_markers.cset, #52162
    2021-10-27 rik5 StatusNone Confirmed
        SummaryMarker Symbol 'I' is not vailable in plot Marker Symbol 'I' and '_' not available in plot
    2021-10-19 pantxo Severity3 - Normal 1 - Wish
        Item GroupMissed Error or Warning Feature Request
        Release6.3.0 dev
        Operating SystemMac OS Any
    2021-10-18 None Attached File- Added Figure@plotted@by@symbol@of@vertical@line.jpg, #52121

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code