Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How do I change the grid linestyle?
Replies: 6   Last Post: Apr 7, 2004 11:18 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
us

Posts: 12,693
Registered: 12/4/04
Re: How do I change the grid linestyle?
Posted: Apr 7, 2004 11:17 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Jens Benecke:
<SNIP is not happy with the behavior of <grid>...

well, let's solve the problem rather than fight it:

% some data
plot(rand(10,1));
% this could be a function...
col=.85*[1 1 1];
xt=get(gca,'xtick');
yt=get(gca,'ytick');
xlim=get(gca,'xlim');
ylim=get(gca,'ylim');
x=[xt;xt];
y=repmat(ylim.',1,size(x,2));
line(x(:,2:end-1),y(:,2:end-1),...
'color',col);
y=[yt;yt];
x=repmat(xlim.',1,size(y,2));
line(x(:,2:end-1),y(:,2:end-1),...
'color',col);

us





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.