plotting 2 x axes on top same side with each having different data range
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Tanmay Singh
il 10 Gen 2022
Risposto: Harikrishnan Balachandran Nair
il 24 Gen 2022
I want to plot a data set as shown in the figure. i have gone through several aswers with above mentioned questions but i am not getting how to set the limit on respective x-axis. here I am attaching a sample data or you can use a sample data of your own.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/858605/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/858605/image.png)
0 Commenti
Risposta accettata
Harikrishnan Balachandran Nair
il 24 Gen 2022
Hi,
I understand that you are having two 'axes' in your figure , and are trying to set different limits for both the 'axes'.
You can use the 'XLim' property of your axes object to set the range of values in the x-axis of the corresponding object. As an example, if ax1 and ax2 are the two 'axes' objects, you can set the limits on 'X-axis' of both the axes differently by using the following lines of code.
ax1.XLim = [100:280] ;
ax2.XLim = [32:116] ;
Please refer to the following Documentations to learn more about this
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Graphics Object Properties 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!