Clear Filters
Clear Filters

Yaxis invisible

3 views (last 30 days)
Ian
Ian on 28 Jan 2011
I would like to make the yaxis invisible without getting rid of the text.
'axis off' is no good, because that gets rid of the ylabel, which I would like to keep.
I have tried:
set(gca,'box','off','ycolor','w')
but this also turns the text color to white.
In the end effect, I just don't want a black outline around my plots to be shown.
I have tried 'box off' but that doesnt seem to get rid of the black outline around my plots or subplots.

Answers (1)

Matt Fig
Matt Fig on 28 Jan 2011
I don't think there is a way of doing it directly. Here is a hackey way of getting what you want for the Y-axis. Do similar for the other axis.
plot(1:10)
X = get(gca,'xlim')
xlim(X)
Y = get(gca,'ylim')
ylim(Y)
P = patch([X(1)-.05 X(1)-.05 X(1)+.1 X(1)+.1],[Y(1) Y(2) Y(2) Y(1)],...
[1 1 1 1],[1 1 1],'edgecolor',[1 1 1])
box off

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!