Reputation: 105
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 e.g. 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
Upvotes: 2
Views: 4792
Reputation: 22225
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 )
Upvotes: 5