From: Yvonne on
Hi,

I am trying to put tick marks on both the y-axis and x-axis of my plot. I have two y-axis on the same plot but the ytick marks appear on one side of the y-axis but did not appear on the side of the yaxis. How do I make the tick marks appear on both the y-axis?

B1 = axes('position',[0.1 0.8 w h]);
B1a = axes('position',[0.1 0.8 w h]);

axes(B1)
axis([5 33 40 98])
x=[17,33,33,17];
y=[40,40,98,98];
x1=[5,7.5,7.5,5];
y1=[40,40,98,98];
f=fill(x,y,[0.7529 0.7529 0.7529]);hold on
f1=fill(x1,y1,[0.7529 0.7529 0.7529]);hold on
p = plot(waikareao_winterDO(:,8),waikareao_winterDO(:,7),'-*');
set(p,'Markersize',5,'MarkerEdgeColor',[0 0 0],'LineWidth',0.5,'Color',[0 0 0])
set(B1,'Xticklabel',[])
text(6,90,'A','fontsize',14)
text(30,93,'Winter')
set(gca,'fontsize',8)
ylabel('Di. oxygen (%)');
axis([5 33 40 98])

axes(B1a)
p = plot(water_w(:,12),water_w(:,11),':k')
set(B1a,'Yaxislocation','right','Xticklabel',[],'fontsize',8,'box','on','Color','none');
set(gca,'fontsize',8)
ylabel('Depth (m)','rotation',270,'Position',[34.4 3.1])
axis([5 33 2 4.2])

Thank you
From: mat001 on
"Yvonne " <hwt3(a)waikato.ac.nz> wrote in message <ht2t0c$9gb$1(a)fred.mathworks.com>...
> Hi,
>
> I am trying to put tick marks on both the y-axis and x-axis of my plot. I have two y-axis on the same plot but the ytick marks appear on one side of the y-axis but did not appear on the side of the yaxis. How do I make the tick marks appear on both the y-axis?
>
> B1 = axes('position',[0.1 0.8 w h]);
> B1a = axes('position',[0.1 0.8 w h]);
>
> axes(B1)
> axis([5 33 40 98])
> x=[17,33,33,17];
> y=[40,40,98,98];
> x1=[5,7.5,7.5,5];
> y1=[40,40,98,98];
> f=fill(x,y,[0.7529 0.7529 0.7529]);hold on
> f1=fill(x1,y1,[0.7529 0.7529 0.7529]);hold on
> p = plot(waikareao_winterDO(:,8),waikareao_winterDO(:,7),'-*');
> set(p,'Markersize',5,'MarkerEdgeColor',[0 0 0],'LineWidth',0.5,'Color',[0 0 0])
> set(B1,'Xticklabel',[])
> text(6,90,'A','fontsize',14)
> text(30,93,'Winter')
> set(gca,'fontsize',8)
> ylabel('Di. oxygen (%)');
> axis([5 33 40 98])
>
> axes(B1a)
> p = plot(water_w(:,12),water_w(:,11),':k')
> set(B1a,'Yaxislocation','right','Xticklabel',[],'fontsize',8,'box','on','Color','none');
> set(gca,'fontsize',8)
> ylabel('Depth (m)','rotation',270,'Position',[34.4 3.1])
> axis([5 33 2 4.2])
>
> Thank you

what is w and h?
From: Yvonne on
"mat001 " <priya.biomath(a)yahoo.co.in> wrote in message <ht3g74$1c1$1(a)fred.mathworks.com>...
> "Yvonne " <hwt3(a)waikato.ac.nz> wrote in message <ht2t0c$9gb$1(a)fred.mathworks.com>...
> > Hi,
> >
> > I am trying to put tick marks on both the y-axis and x-axis of my plot. I have two y-axis on the same plot but the ytick marks appear on one side of the y-axis but did not appear on the side of the yaxis. How do I make the tick marks appear on both the y-axis?
> >
> > B1 = axes('position',[0.1 0.8 w h]);
> > B1a = axes('position',[0.1 0.8 w h]);
> >
> > axes(B1)
> > axis([5 33 40 98])
> > x=[17,33,33,17];
> > y=[40,40,98,98];
> > x1=[5,7.5,7.5,5];
> > y1=[40,40,98,98];
> > f=fill(x,y,[0.7529 0.7529 0.7529]);hold on
> > f1=fill(x1,y1,[0.7529 0.7529 0.7529]);hold on
> > p = plot(waikareao_winterDO(:,8),waikareao_winterDO(:,7),'-*');
> > set(p,'Markersize',5,'MarkerEdgeColor',[0 0 0],'LineWidth',0.5,'Color',[0 0 0])
> > set(B1,'Xticklabel',[])
> > text(6,90,'A','fontsize',14)
> > text(30,93,'Winter')
> > set(gca,'fontsize',8)
> > ylabel('Di. oxygen (%)');
> > axis([5 33 40 98])
> >
> > axes(B1a)
> > p = plot(water_w(:,12),water_w(:,11),':k')
> > set(B1a,'Yaxislocation','right','Xticklabel',[],'fontsize',8,'box','on','Color','none');
> > set(gca,'fontsize',8)
> > ylabel('Depth (m)','rotation',270,'Position',[34.4 3.1])
> > axis([5 33 2 4.2])
> >
> > Thank you
>
> what is w and h?

Opps, sorry. w and h are the width and height, which in this case

w =0.33;
h =0.15;

B1 = axes('position',[0.1 0.8 w h]);
B1a = axes('position',[0.1 0.8 w h]);