Display part of a legend

2 views (last 30 days)
Jorge Reveron
Jorge Reveron on 21 Apr 2021
Answered: Jonas on 21 Apr 2021
Hello,
I'm trying to display a part of a legend on the following script on Matlab2018a:
fill(VWP,Depth2,'g','FaceColor',[0.7294 0.8314 0.9569])
hold on
fill(VOP,Depth2,'g','FaceColor',[0 1 0])
hold on
legend('Brine','Hydrocarbon','Quartz','Clay');
set(legend,'EdgeColor',[1 1 1],'Orientation','horizontal',...
'Position',[0.09026 0.01693 0.6888 0.03283],'FontName','helvetica','Fontsize',12);
% Plot horizontal lines at certain depth
plot(x,y(i,:),'r');
set (gca,'Ydir','reverse')
hold on
I want to display only the legend with names: Brine,Hydrocarbon,Quartz and Clay, but it appears also the legend of all the horizontal lines in vector (see attachment) . How Do I eliminate the lagend data 1,2,...?
Thanks in advance,
Jorge

Answers (1)

Jonas
Jonas on 21 Apr 2021
you can set the legend property 'AutoUpdate' to 'off' before you create the objects you dont want to see

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!