Code Monkey home page Code Monkey logo

zoomplot-matlab's Introduction

ZoomPlot

MATLAB Code for Interactive Magnification of Customized Regions.

Version 1.3, 17-JAN-2022

Email: [email protected]


✨ Main features

  • Easy application with just two lines of code
  • Interactive plotting
  • Support for image and figure classes
  • Support for multiple zoomed zones
  • Custom settings of parameters and themes

⚠️ Requirements

  • R2014b and later releases
  • Image Processing Toolbox

👉 How to use

  1. Add BaseZoom.m file to MATLAB search path or current working directory
  2. After completing the basic drawing, enter the following two lines of code in the command line window or your m-file:
% add a zoomed zone
zp = BaseZoom();
zp.plot;

if multiple zoomed zones are required, for example, 3 zoomed zones, the code are as follows:

% add 3 zoomed zones
zp = BaseZoom();
zp.plot;
zp.plot;
zp.plot;

👉 Examples for image class

Multiple types of image are supported for interactive magnification of customized regions in the ZoomPlot.

👉 Examples for figure class

Multiple zoomed zones are supported for figure class.

👉 How to customize the theme of the sub-coordinate system

Just modify the properties of the BaseZoom class file. The default properties are:

    % theme of inserted axes (sub-axes)
    properties
        subAxesBox = 'on'
        subAxesinsertedLineWidth = 1.2
        subAxesTickDirection = 'in'
        subAxesBackgroundColor = 'w'
    end

For example, remove the border of the sub-coordinate system and set the line width to 3:

    % theme of inserted axes (sub-axes)
    properties
        subAxesBox = 'off'
        subAxesinsertedLineWidth = 3
        subAxesTickDirection = 'in'
        subAxesBackgroundColor = 'w'
    end

👉 How to customize the theme of the zoomed zone

Just modify the properties of the BaseZoom class file. The default properties are:

    % theme of the zoomed zone (figures)
    properties
        rectangleColor = 'k'
        rectangleFaceColor = 'none'
        rectangleFaceAlpha = 0
        rectangleLineStyle = '-'
        rectangleLineWidth = 1.2
        rectangleInteractionsAllowed = 'none'
    end

For example, set the line color to red and the line width to 2:

    % theme of the zoomed zone (figures)
    properties
        rectangleColor = 'r'
        rectangleFaceColor = 'none'
        rectangleFaceAlpha = 0
        rectangleLineStyle = '-'
        rectangleLineWidth = 2
        rectangleInteractionsAllowed = 'none'
    end

👉 How to customize the theme of the connected lines

Just modify the properties of the BaseZoom class file. The default properties are:

    % theme of the connected lines (figures)
    properties
        % setting of lines between arrows
        figureConnectedLineStyle = ':'
        figureConnectedLineColor = 'k'
        figureConnectedLineWidth = 1.2
        % setting of start arrow
        figureConnectedLineStartHeadStyle = 'ellipse' % shape of start arrow
        figureConnectedLineStartHeadLength = 3
        figureConnectedLineStartHeadWidth = 3
        % setting of end arrow
        figureConnectedLineEndHeadStyle = 'cback2' % shape of ending arrow
        figureConnectedLineEndHeadLength = 7
        figureConnectedLineEndHeadWidth = 7
    end

For example, set the shape of ending arrow to 'ellipse' and the line color to 'b':

    % theme of the connected lines (figures)
    properties
        % setting of lines between arrows
        figureConnectedLineStyle = ':'
        figureConnectedLineColor = 'r'
        figureConnectedLineWidth = 1.2
        % setting of start arrow
        figureConnectedLineStartHeadStyle = 'ellipse' % shape of start arrow
        figureConnectedLineStartHeadLength = 3
        figureConnectedLineStartHeadWidth = 3
        % setting of end arrow
        figureConnectedLineEndHeadStyle = 'ellipse' % shape of ending arrow
        figureConnectedLineEndHeadLength = 7
        figureConnectedLineEndHeadWidth = 7
    end

zoomplot-matlab's People

Contributors

iqiukp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.