contourx

Plot a 2D contour and visualise linear profiiles crossing at a chosen point.
272 Downloads
Updated 11 Aug 2015

View License

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
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Contour Plots in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
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.
Added some example calls and MWE.