bugGNU Octave - Bugs: bug #58386, function request: drawaxis

 
 

bug #58386: function request: drawaxis

Submitter:  Leonardo <pocker>
Submitted:  Sun 17 May 2020 09:49:52 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 5.2.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 12 Oct 2020 11:33:46 AM UTC, comment #1: 

This sounds very similar to what setting "xaxislocation" or "yaxislocation" to "origin" does (apart from drawing arrow heads).

Markus Mützel <mmuetzel>
Group administrator
Sun 17 May 2020 09:49:52 PM UTC, original submission:  

Hello,

sometimes when doing plots, I like to have the x-axis and the y-axis plotted with arrows thus, the ideia is: after ploting things, call function "drawaxis" with or without parameters, and the lines/arrows of axis are displayed.

One way to do this is to use the "annotation" but this requires the normalized numbers of the current figure. And this is a bit cumbersome.

Probably there are a lot of other methods to this but I could not find a simple one.

If octave already has something similar, well, at least I learned a couple of things :)

So, I decided to create my own version of function drawaxis and I would like to share it.

I attached the function as well as some figures.

To use it:


plot((-2:10),randn(13,1))
drawaxis(10,pi/6,0.5);


A few things I would like to implement but I don't know how:

1) if the range (xlim/ylim) is changed, how to redraw the drew axis?
2) if figure window has its size changed, how to redraw the drew axis?
3) parameteres like linewidth and color could be passed to function, but how? Using varargin, maybe? Have no idea.

Kind regards,
Leonardo

Leonardo <pocker>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #49109:  angle_and_size.png added by pocker (19KiB - image/png - This one is the correct one)
file #49105:  drawaxis.m added by pocker (5KiB - text/x-objcsrc)
file #49106:  angle_and_size.png added by pocker (18KiB - image/png)
file #49107:  notch.png added by pocker (21KiB - image/png)
file #49108:  example2.png added by pocker (15KiB - 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 mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by pocker (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-01 jwe CategoryNone Plotting
    2020-05-17 pocker Attached File- Added angle_and_size.png, #49109
    2020-05-17 pocker Attached File- Added drawaxis.m, #49105
        Attached File- Added angle_and_size.png, #49106
        Attached File- Added notch.png, #49107
        Attached File- Added example2.png, #49108

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code