louis
louis

Reputation: 41

How to change marker style in polar plot with octave?

I am trying to change the appearance of the markers in a polar plot in octave.

r = rand(1,10); % the radius
t = 30*rand(1,10); % the angles
polar(t,r,'o') % the plot

It seems we can only change the shape, by replacing 'o' by 's' or whatever. However, I didn't find a way to change the size and the colors of the markers. Does anyone have an idea?

Thanks in advance. Best,

Upvotes: 3

Views: 620

Answers (1)

S. Gougeon
S. Gougeon

Reputation: 911

It is possible through the polar handle:

h = polar(t,r,'o')
% list all graphical properties for this object
get(h)
set(h,'marker','v', 'markerfacecolor','g', 'markersize',10)

yields

>> h = polar(t,r,'o') % the plot
h = -64.073
>> get(h)
ans =
  scalar structure containing the fields:
    beingdeleted = off
    busyaction = queue
    buttondownfcn = [](0x0)
    children = [](0x1)
    clipping = on
    createfcn = [](0x0)
    deletefcn = [](0x0)
    handlevisibility = on
    hittest = on
    interruptible = on
    parent = -69.944
    pickableparts = visible
    selected = off
    selectionhighlight = on
    tag =
    type = line
    uicontextmenu = [](0x0)
    userdata = [](0x0)
    visible = on
    color =
            0   0.4470   0.7410
    displayname =
    linejoin = round
    linestyle = none
    linewidth = 0.5000
    marker = o
    markeredgecolor = auto
    markerfacecolor = none
    markersize = 6
    xdata =
     Columns 1 through 6:
       0.978470  -0.060967  -0.436276  -0.268739   0.441890  -0.586862 
     Column 7 through 10:
       0.746687  -0.063825   0.368511   0.271495
    xdatasource =
    ydata =
     Columns 1 through 6:
       0.049178  -0.426698   0.380388  -0.101611  -0.699609  -0.266804   
     Column 7 through 10:
       0.383766  -0.903458   0.764035  -0.126044
    ydatasource =
    zdata = [](0x0)
    zdatasource =

>> set(h,'marker','v', 'markerfacecolor','g', 'markersize',10)

enter image description here

Upvotes: 4

Related Questions