Thread Subject: R2009a: Setting GridLines Color Different to Axis Color...

Subject: R2009a: Setting GridLines Color Different to Axis Color...

From: Andrey Kazak

Date: 24 Jun, 2009 17:25:03

Message: 1 of 8

Greetings!

I've read the bulletin:
http://www.mathworks.com/support/solutions/data/1-1PAYMC.html?solution=1-1PAYMC)

and it states: "... This enhancement has been incorporated in Release 2008a (R2008a)."
What is it?

Could you help me to figure out the way to set GridLines Color different to Axis Color please?

Subject: R2009a: Setting GridLines Color Different to Axis Color...

From: Nathan

Date: 24 Jun, 2009 22:27:58

Message: 2 of 8

On Jun 24, 10:25 am, "Andrey Kazak" <A...@nospam.ru> wrote:
> Greetings!
>
> I've read the bulletin:http://www.mathworks.com/support/solutions/data/1-1PAYMC.html?solutio...)
>
> and it states: "... This enhancement has been incorporated in Release 2008a (R2008a)."
> What is it?
>
> Could you help me to figure out the way to set GridLines Color different to Axis Color please?


Did you not read the whole bulletin?...
Try this.
c_axes = copyobj(gca,gcf);
set(c_axes, 'color', 'r', 'xcolor', 'y', 'xgrid', 'off', 'ycolor','b',
'ygrid','off');

-Nathan

Subject: R2009a: Setting GridLines Color Different to Axis Color...

From: Nathan

Date: 24 Jun, 2009 22:33:03

Message: 3 of 8

On Jun 24, 3:27 pm, Nathan <ngrec...@gmail.com> wrote:
> On Jun 24, 10:25 am, "Andrey Kazak" <A...@nospam.ru> wrote:
>
> > Greetings!
>
> > I've read the bulletin:http://www.mathworks.com/support/solutions/data/1-1PAYMC.html?solutio...)
>
> > and it states: "... This enhancement has been incorporated in Release 2008a (R2008a)."
> > What is it?
>
> > Could you help me to figure out the way to set GridLines Color different to Axis Color please?
>
> Did you not read the whole bulletin?...
> Try this.
> c_axes = copyobj(gca,gcf);
> set(c_axes, 'color', 'r', 'xcolor', 'y', 'xgrid', 'off', 'ycolor','b',
> 'ygrid','off');
>
> -Nathan

Oops, left off a part.

ezplot('x')
grid on
set(gca,'Xcolor','r')
c_axes = copyobj(gca,gcf);
set(c_axes, 'color', 'none', 'xcolor', 'y', 'xgrid', 'off',
'ycolor','b', 'ygrid','off');

Play with that and get the colors you want.
-Nathan

Subject: R2009a: Setting GridLines Color Different to Axis Color...

From: Andrey Kazak

Date: 25 Jun, 2009 16:45:03

Message: 4 of 8

Nathan <ngreco32@gmail.com> wrote in message <d90c7cfc-d37d-4e34-b215-dee128a2c437@y4g2000prf.googlegroups.com>...
> On Jun 24, 3:27?pm, Nathan <ngrec...@gmail.com> wrote:
> > On Jun 24, 10:25?am, "Andrey Kazak" <A...@nospam.ru> wrote:
> >
> > > Greetings!
> >
> > > I've read the bulletin:http://www.mathworks.com/support/solutions/data/1-1PAYMC.html?solutio...)
> >
> > > and it states: "... This enhancement has been incorporated in Release 2008a (R2008a)."
> > > What is it?
> >
> > > Could you help me to figure out the way to set GridLines Color different to Axis Color please?
> >
> > Did you not read the whole bulletin?...
> > Try this.
> > c_axes = copyobj(gca,gcf);
> > set(c_axes, 'color', 'r', 'xcolor', 'y', 'xgrid', 'off', 'ycolor','b',
> > 'ygrid','off');
> >
> > -Nathan
>
> Oops, left off a part.
>
> ezplot('x')
> grid on
> set(gca,'Xcolor','r')
> c_axes = copyobj(gca,gcf);
> set(c_axes, 'color', 'none', 'xcolor', 'y', 'xgrid', 'off',
> 'ycolor','b', 'ygrid','off');
>
> Play with that and get the colors you want.
> -Nathan

Thank you, Nathan!

Of course I've seen this information, but what is the "enhancement" method mentioned in the bulletin?

Subject: R2009a: Setting GridLines Color Different to Axis Color...

From: Andrey Kazak

Date: 3 Jul, 2009 05:52:01

Message: 5 of 8

Any new on the topic?

Subject: R2009a: Setting GridLines Color Different to Axis Color...

From: Paul Mennen

Date: 4 Jul, 2009 01:34:02

Message: 6 of 8

Nathan wrote
> Try this.
> c_axes = copyobj(gca,gcf);
> set(c_axes, ...

Looks pretty cryptic to me. One shouldn't have to resort to such cryptic commands for such commonplace tasks. Assuming you are creating 2D plots, an alternative to consider is the "plt" function from the file exchange. (My creation, I'm proud to admit.) For one thing, the default grid color is much more subtle and reasonable so you may never be possessed to change it. But if you do want to change it, simply use the 'GRIDc' argument as spelled out in the help file. And of course I wouldn't have done anything as silly as linking the grid color in any way to the x or y axis ticks or labels. Also plt works the same in any version of Matlab released within the last 8 years.

If you try plt, I think you will find that one of its strongest advantages over the native "plot" is the well organized help file which clearly explains all the plotting features (with examples!). With plt you won't have to become a handle graphics expert to deal with the poorly documented and cryptic auxiliary functions such as plotyy, plotyyy, etc.

~Paul

Subject: R2009a: Setting GridLines Color Different to Axis Color...

From: Steven Lord

Date: 6 Jul, 2009 00:35:17

Message: 7 of 8


"Andrey Kazak" <AK@nospam.ru> wrote in message
news:h209if$f7g$1@fred.mathworks.com...

*snip*

> Of course I've seen this information, but what is the "enhancement" method
> mentioned in the bulletin?

I'm pretty sure that means the information given in that document was
incorporated into the documentation in release R2008a.

--
Steve Lord
slord@mathworks.com

Subject: R2009a: Setting GridLines Color Different to Axis Color...

From: Andrey Kazak

Date: 6 Jul, 2009 06:27:00

Message: 8 of 8

"Steven Lord" <slord@mathworks.com> wrote in message <h2rgqj$3pk$1@fred.mathworks.com>...
>
> "Andrey Kazak" <AK@nospam.ru> wrote in message
> news:h209if$f7g$1@fred.mathworks.com...
>
> *snip*
>
> > Of course I've seen this information, but what is the "enhancement" method
> > mentioned in the bulletin?
>
> I'm pretty sure that means the information given in that document was
> incorporated into the documentation in release R2008a.
>
> --
> Steve Lord
> slord@mathworks.com
>

The strange thing I see...
I cannot find the mentioned code in MATLAB help. However could you please look at the following:

http://www.mathworks.com/support/solutions/data/1-1PAYMC.html?solutio...)
(updated on 06 Apr 2009)
and
http://www.mathworks.com/support/solutions/en/data/1-1PAYMC/?solution=1-1PAYMC
(updated on Wednesday, July 1, 2009)

The older one states that "This enhancement has been incorporated in Release 2008a (R2008a)" while the newer one lacks for this statement...
How should one understand this?

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gridlines Andrey Kazak 24 Jun, 2009 13:29:03
axis Andrey Kazak 24 Jun, 2009 13:29:03
color Andrey Kazak 24 Jun, 2009 13:29:03
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com