Grid

조회 수: 6 (최근 30일)
Slobodan Djordjevi?
Slobodan Djordjevi? 2011년 12월 13일
Hello!
Quick question. My GUI has "axes1"(graph), this graph refreshes if I click a certain PushButton. The thing is my graph has two plots. One is the main one and the other is just there as a limit. I separated them with HOLD ON. All is OK, but when I hit refresh the grid disappears, if I click again it suddenly reappears. The only way that I could get it to stay is by deleting the other minor "plot". I tried putting them together in one plot but no luck. I tried placing "grid minor" everywhere but still nothing.
I used "case" structure.
Any suggestions?
My Code :
case 2
fid = fopen('ICl.txt');
A = textscan(fid, '%f %*f %f %*s');
fclose(fid);
startDate = datenum('01-01-2011')
endDate = datenum('12-31-2011')
xData = linspace(startDate,endDate,12);
plot(A{1,1},A{1,2}, '--ks','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','b',...
'MarkerSize',10);
ylim([0 inf])
set(gca,'YTick',[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1])
set(gca,'XTick',xData)
datetick('x','mmm','keepticks')
title('JODOV KLORID (datum odprtja: 11.4.2010)')
ylabel('masa[g]')
xlabel('2011')
grid minor;
hold on;
x = 734506:1:734867;
y = 100;
plot(x, y, 'rs', 'LineWidth', 3, 'MarkerSize', 1.5);

채택된 답변

Laura Proctor
Laura Proctor 2011년 12월 13일
I may be oversimplifying it, but perhaps issue a
hold off
at the end of the code and see if this gives you behavior you desire.
grid minor is a toggle, so that if you issue it and then have a hold on, then when it is issued again, it will toggle off.
  댓글 수: 1
Slobodan Djordjevi?
Slobodan Djordjevi? 2011년 12월 13일
YOU ARE AMAZING! Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by