Code covered by the BSD License  

Highlights from
Draw two figures with separate x and y axis

Be the first to rate this file! 16 Downloads (last 30 days) File Size: 2.23 KB File ID: #31944
image thumbnail

Draw two figures with separate x and y axis

by Nassim Khaled

 

24 Jun 2011

This script plots two sets of 1D data on the same figure.

| Watch this File

File Information
Description

This script plots two sets of 1D data on the same figure with two separate axis and with the same gridding.
The code also checks if the x-axis data are the same, if the x-axis data
are not the same, it draws an additional x-axis on the top of the figure.
The two sets of data with their axes are drawn with two colors for ease of reading

Acknowledgements
This submission has inspired the following:
Fancy DualGraphs
MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
24 Jun 2011 Jan Simon

"[0:.3:40]" is less efficient than "0:.3:40".
It might be helpful to mention Matlab's built-in PLOTYY in a "See also" line, because it does almost the same.

27 Jun 2011 Nassim Khaled

Hi Jan. Thanks for the constructive comment.You are right(in all of what you said). This function is very similar to plotyy, yet people are always asking about this, and for some reason, it is easier to find these files on Matlab central than Matlab help.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data export Nassim Khaled 24 Jun 2011 10:32:16
plot Nassim Khaled 24 Jun 2011 10:32:16
axes Nassim Khaled 24 Jun 2011 10:32:16
two axes Nassim Khaled 24 Jun 2011 10:32:16
2d plot Nassim Khaled 24 Jun 2011 10:32:16
two axis Nassim Khaled 24 Jun 2011 10:32:16
plotyy Nassim Khaled 27 Jun 2011 10:45:41
axes Benjamin 24 Nov 2011 07:54:13

Contact us at files@mathworks.com