Octave : How to change line color and width in dra

2019-08-29 03:43发布

问题:

:-) Hi, guys.

Is there any way to change the line color and width of function drawRect in Octave ?

According to its reference, there's no property-value pair to set in this function.

Thanks.

回答1:

The function does accept a property-value pair, but it does return a graphics handle from where you can set any property:

r = drawRect (x, y, w, h);
set (r, "color", [1 0 0]); # set to red (RGB triplets)
set (r, "linewidth", 5);

Use get (r) to see a list of all properties, or read the manual section graphics object properties.