Set custom x and y axis
23 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi All,
I have a quick and I believe it would be fairly easy as well but being a newbie I am not able to crack it.
I have one image having x and y axis values as of 0-640 and 0-1024 respectively. Now, I can plot these same numbers easily but is there a way where I can put custom values on both axis as I would like to put 0-1 in y and 0-2 in y axis?
I have tried basic commands such as axis([xmin xmax ymin ymax]) but it also changes the orientation and the image I have completely.
Question: How to plot custom axis value in both axis while keeping the image same?
I have also attached the image I am working on. Please help, thanks.
0 Commenti
Risposte (1)
Kian Azami
il 7 Ott 2017
Modificato: Kian Azami
il 7 Ott 2017
Maybe you just need to use:
xlim([xmin xmax])
ylim([ymin ymax])
2 Commenti
Kian Azami
il 7 Ott 2017
It is strange that it changes the orientation. Maybe put your image and code here which is easier to check for everyone.
If you want to change the axis values by yourself you need to access to the properties of the axis. So you can do this by going to plot tools and then clicking on the white areas in your figure (I mean to choose the axis) and then go to 'Ticks...' properties and change them.
Or you can do it by writing code:
Figure_Axis = get(gcf,'children');
set(Figure_Axis,'YTickLabelMode','manual')
Y_Label_Positions = get(Figure_Axis,'YTick')
Y_Label = get(Figure_Axis,'YTickLabel')
you need to change Y_Label to show the values that you want. If you want to change their position you need to change the values of Y_Label_Positions also. But before that, you need to make it manual:
set(Figure_Axis,'YTickMode','manual')
You can use the same for the other axis.
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!