简体   繁体   中英

Plotting a transparency patch on octave

I made a plot on octave and to put on evidence a specific region of the plot I want to put over a rectangle or patch eg yellow but transparent in order to see the plot behind. I googled but I didn't find a solution. Please, could you help me? Thanks

Use a rectangle object, and reach into its properties to set its child's transparency.

X = [0:0.1:10];
p = plot( X, 3 * sin(X) + X )
grid on
r = rectangle('position', [3, 1, 3, 3], 'curvature', 0.25, 'edgecolor','k', 'facecolor', 'y' )
set( get(r, 'children'), 'facealpha', 0.25 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM