a command for having the ygrid on only , on figure , with set(gca , ),, ... .. ...How ?

 Accepted Answer

set(gca, 'YGrid', 'on', 'XGrid', 'off')

5 Comments

thanks I had this error There is no 'YGrid' property in the 'figure' class.
Is that problem still happening? Or you were set()'ing against the wrong thing before?
yes still
I tried all options
it really weasted alot of my time , but it will save much time if igot it I have alot of figures from my model ,
This is one set of my command please look at it and if there any way ,
So insted of grid on , I want a command for ygrid only (xgrid off)how and what command is good in this case ( for Seqbeta you could put any vector )
Try this. It works perfectly fine:
y=rand(1,20);
plot(y);
set(gca, 'YGrid', 'on', 'XGrid', 'off')
Your mistake was that you did this:
gca=figure('Units','inches','Position', [7.5 5.5 6 4]); %[left, bottom, width, height]:
This overwrote the built-in gca with a figure handle. DON'T DO THAT! So now gca is a figure handle of the figure you just created instead of being (automatically) the handle of the axes that gets created on the figure. Using a figure handle instead of an axes handle like Walter instructed you to will give you an error almost exactly what you shared.
Sorry I had to go away Now I got it thank you Walter and image anlayst
this is example
set(figure,'Units','inches','Position',[7 0.5 7 5],'DefaultAxesFontName','Arial', ... 'DefaultAxesFontSize',12,'DefaultAxesFontWeight','Normal');
y=rand(1,10);
% plot(y,'Color','r','Marker', 'o'); plot(y,'-.ms','lineWidth',1.5,'MarkerEdgeColor','m','MarkerFaceColor','g','MarkerSize',10); set(gca, 'YGrid', 'on', 'XGrid','off');
text(1,.7,['\fontsize{16}Thanks {\color{magenta}for '... '\color[rgb]{0 .5 .5}your \color{red}concern} and answer It help allot']) legend(gca,'Thank you \circALLOOOT','location','northeast'); box on ylabel('y','FontSize',12,'fontweight','Normal'); xlabel('x','FontSize',12,'fontweight','Normal');

Sign in to comment.

More Answers (0)

Products

Tags

Community Treasure Hunt

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

Start Hunting!