plot(x,y) does not show x-cordinate and y-ordinates

whenever I plot something like using plot(x,y), the plot does not show x-cordinate and y-ordinates details beside the axis as it normally does. What should I do to bring back x-ordinate and y-cordinate details in the figure?

1 Comment

Hi Anindya, You should show an example of what you mean by this.
Wayne

Sign in to comment.

Answers (1)

Hi Anindya, Please show the MATLAB code that you are using to produce that plot.
Ex:
x = 0:0.01:2*pi;
y = sin(x);
plot(x,y);

3 Comments

x = -pi:0.01:pi;
y = sin(x);
plot(x,y);
I've used the above code. the problem as i explained previously i can't see any xTicklabel or yTicklabel on the graph.
This is very strange Anindya, just to be clear, you are not seeing xticks and yticks in MATLAB, not after you export the figure to some format? By default, you should have xticks and yticks with the above code.
A couple things, are you sure that you are using MATLAB plot. If you enter
>>which plot
do you get something back like:
matlab\toolbox\matlab\graph2d\plot
If you execute the following:
x = -pi:0.01:pi;
y = sin(x);
plot(x,y);
get(gca,'xtick')
get(gca,'ytick')
what is returned?
>> which plot
built-in (/usr/local/MATLAB/R2011a/toolbox/matlab/graph2d/plot)
>> get(gca,'xtick')
ans =
-5 0 5
>> get(gca,'ytick')
ans =
-1 0 1
>> get(gca,'xTickLabel')
ans =
-5
0
5
>> get(gca,'yTickLabel')
ans =
-1
0
1
I know by default plot(x,y) should show xtick and yticklabels which is not the case. I have no idea what's wrong!!!

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Tags

Asked:

on 17 Sep 2011

Community Treasure Hunt

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

Start Hunting!