Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to plot axis on top of graph data (uglyness bugs)

3 views
Skip to first unread message

Bas

unread,
Apr 11, 2008, 9:52:25 AM4/11/08
to
Hi group,

if I do a simple
plot(0.1*randn(1,10000),'m')
it is clearly visible that the axis is plotted first and then the
graph data on top of that, obscuring part of the y-axis and some of
its tickmarks. I find this plain ugly, I think that the axis should
clip all content contained within. I would like to see a plot as a
framed painting, where the frame never contains a drop of paint
(except for some modern art) and usually is clipping the outer edges
of the canvas. Is there any way to reverse the plotting order, so that
the axis is plotted on top?

IMHO, this plot shows another problem, namely that the origin is
labeled '0' instead of '0.0'. This spoils the right alignment of the
yticks and hurts my eyes everytime I see it. I know this is easily
fixable with yticklabels, but I don't want to do that for every plot.
If anyone from Mathworks is listening, can these two problems be
considered bugs, or do we have to accept them as features?

Cheers,
Bas

someone

unread,
Apr 11, 2008, 12:01:07 PM4/11/08
to
Bas <weg...@gmail.com> wrote in message <660980ad-7059-
4002-bc00-7...@y18g2000pre.googlegroups.com>...

As you point out, your bug is my feature. I personally
don't want the axis obscuring my data. But, in your above
example, you could use the xlim command:

xlim([-100 10100])

Walter Roberson

unread,
Apr 11, 2008, 12:15:57 PM4/11/08
to
In article <660980ad-7059-4002...@y18g2000pre.googlegroups.com>,
Bas <weg...@gmail.com> wrote:

>IMHO, this plot shows another problem, namely that the origin is
>labeled '0' instead of '0.0'. This spoils the right alignment of the
>yticks and hurts my eyes everytime I see it. I know this is easily
>fixable with yticklabels, but I don't want to do that for every plot.
>If anyone from Mathworks is listening, can these two problems be
>considered bugs, or do we have to accept them as features?

I do not consider using 0 as the origin to be a bug. Often the tick
labels are at integral positions -- for example, it would not
make sense to label the ticks as 0.0 5000.0 10000.0 15000.0 .

Perhaps Matlab could add a DefaultAxesTickLabelFormat root property
corresponding TickLabelFormat axis property. But since most people
create or replace axes implicitly instead of explicitly, they would
probably still end up having to make an explicit set() call to
change the format for a particular plot.

Question: do you object that your polar plots are labeled with 0
degrees instead of 0.0 degrees, when the other degree labels are all
integer?
--
"MAMA: Oh--So now it's life. Money is life. Once upon a time freedom
used to be life--now it's money. I guess the world really do change.
WALTER: No--it was always money, Mama. We just didn't know about it."
-- Lorraine Hansberry

Doug Schwarz

unread,
Apr 11, 2008, 12:57:54 PM4/11/08
to

> Hi group,
>
> if I do a simple
> plot(0.1*randn(1,10000),'m')
> it is clearly visible that the axis is plotted first and then the
> graph data on top of that, obscuring part of the y-axis and some of
> its tickmarks. I find this plain ugly, I think that the axis should
> clip all content contained within. I would like to see a plot as a
> framed painting, where the frame never contains a drop of paint
> (except for some modern art) and usually is clipping the outer edges
> of the canvas. Is there any way to reverse the plotting order, so that
> the axis is plotted on top?

Yes,

set(gca,'Layer','top')

will do what you want. You can set it as a default with

set(0,'DefaultAxesLayer','top')

in your startup.m file.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

0 new messages