contourx
The function obtains a contour plot of 2D (x,y) data and draws the x- and y-profiles of the variable at a point specified by the moving cursor. The coordinates of the chosen point are shown at the top of the contour. Zooming in and out of the contour plot is possible by the common tools in the toolbar. The axes of the two smaller line plots are automatically updated accordingly.
The code was written so as to make it possible for the user to easily customize it according to his/her needs. We demonstrate the use of WindowButtonMotionFcn (which allows one to obtain the current position of the mouse) and callbacks, whilst maintaining the code as simple as possible.
Minimal Working Example (MWE):
contourx(peaks(20));
Other example calls:
Z=peaks(20); contourx(Z);
[C,h]=contourx(x,y,V,30);
contourx(fig_handle,x,y,V,30,'r-.');
Many thanks to Cyprian Lewandowski for his precious advice.
-----
Screenshot: application of contourx to visualize the quadrupole out-of-plane magnetic field in the Magnetic Reconnection Experiment (MRX).
Cite As
Francesco Sciortino (2024). contourx (https://www.mathworks.com/matlabcentral/fileexchange/52441-contourx), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > 2-D and 3-D Plots > Contour Plots >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 | The figure shows an application of contourx.m with data from the Magnetic Reconnection Experiment (MRX). Explanation of screenshot.
|