do not display value on the axis

Hi,
I am looking for a code that allows me to plot a figure where there are no value displayed on the x axis
I tried to use this code here:
set(gca,'xtick',[])
but that didn't work, any suggestions?

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 18 日

6 投票

Maybe the order is not good
plot(1:3,1:3)
set(gca,'xtick',[])

4 件のコメント

Locks
Locks 2013 年 5 月 18 日
編集済み: Locks 2013 年 5 月 18 日
I have this code
dates=datenum(dataSet(:,1));
%SPX
SPX=dataSet(:,2);
%VIX
VIX=dataSet(:,3);
plotyy(dates,SPX,dates,VIX);
set(gca, 'xticklabel', []);
and this is not working
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 18 日
x=0:100;
y1=cos(x);
y2=sin(x);
[ax,h1,h2]=plotyy(x,y1,x,y2)
set(ax,'xtick',[])
Locks
Locks 2013 年 5 月 18 日
that's working, thank you
Trippy
Trippy 2020 年 12 月 7 日
Try this.
set(gca,'XTick',[],'YTick',[])

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2013 年 5 月 18 日

1 投票

Try this:
set(gca, 'xtick', [-inf inf]);

6 件のコメント

Image Analyst
Image Analyst 2013 年 5 月 18 日
Locks
Locks 2013 年 5 月 18 日
doesn't work either
the code I am using is the following:
dates=datenum(dataSet(:,1));
%SPX
SPX=dataSet(:,2);
%VIX
VIX=dataSet(:,3);
plotyy(dates,SPX,dates,VIX);
set(gca, 'xtick', [-inf inf]);
Image Analyst
Image Analyst 2013 年 5 月 18 日
編集済み: Image Analyst 2013 年 5 月 18 日
Explain why it does not work. It plots something in an axes control "where there are no value displayed on the x axis" just like you asked for.
Give me something we can run:
Undefined variable dataSet.
Error in test3 (line 1)
dates=datenum(dataSet(:,1));
Locks
Locks 2013 年 5 月 18 日
dates=[1,2,3,4]
SPX=[0.1,0.2,0.1,0.2]
VIX=[0.02,0.28,0.2,0.3]
%dates=datenum(dataSet(:,1));
%SPX
%SPX=dataSet(:,2);
%VIX
%VIX=dataSet(:,3);
plotyy(dates,SPX,dates,VIX);
set(gca, 'xtick', [-inf inf]);
does not work either
Image Analyst
Image Analyst 2013 年 5 月 18 日
It doesn't seem to work because you used plotyy() instead of plot(). Do you really need two y axes? Can you use one common one?
dates=[1,2,3,4]
SPX=[0.1,0.2,0.1,0.2]
VIX=[0.02,0.28,0.2,0.3]
plot(dates,SPX,'gs-');
hold on;
plot(dates,VIX, 'bd-');
set(gca, 'xtick', [-inf inf]);
Locks
Locks 2013 年 5 月 18 日
I need two seperated axis due to the fact that the values on the left side go from around 1000 to around 2000 and on the right from 0 to 100

サインインしてコメントする。

カテゴリ

質問済み:

2013 年 5 月 18 日

コメント済み:

2020 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by