Giter Site home page Giter Site logo

ohmyjesus / zoomplot-matlab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iqiukp/zoomplot-matlab

0.0 0.0 0.0 12.78 MB

MATLAB Code for Interactive Magnification of Customized Regions.

License: BSD 3-Clause "New" or "Revised" License

MATLAB 100.00%

zoomplot-matlab's Introduction

ZoomPlot

MATLAB Code for Interactive Magnification of Customized Regions.

Version 1.4, 30-MAY-2023

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

  • R2016a and later releases
  • Image Processing Toolbox

👉 How to use

  1. Add BaseZoom.m and parameters.json 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.

👉 Customize parameters using json files

ZoomPlot's configuration parameters are stored in parameters.json and have the following default values:

{
    "subAxes": 
        {
            "Color": "none",
            "LineWidth": 1.2,
            "XGrid": "off",
            "YGrid": "off",
            "ZGrid": "off",
            "GridAlpha": 0.15,
            "GridColor": [0.15, 0.15, 0.15],
            "GridLineStyle": "-",
            "Box": "on",
            "TickDir": "in",
            "Comments": "theme of the sub axes"
        },

    "zoomedArea": 
        {
            "Color": "k",
            "FaceColor": "none",
            "FaceAlpha": 0,
            "LineStyle": "-",
            "LineWidth": 1.5,
            "Comments": "theme of the zoomed area"
        },

     "dynamicRect": 
        {
            "LineColor": [0, 0.4471, 0.7412],
            "LineWidth": 2,
            "Marker": "s",
            "MarkerSize": 9,
            "FaceColor": [0, 0.4471, 0.7412],
            "FaceAspect": 0.3,
            "EdgeColor": "k",
            "Comments": "theme of the zoomed area"
        },

     "connection": 
        {
            "LineColor": "k",
            "LineWidth": 1.5,
            "LineStyle": ":",
            "StartHeadStyle": "ellipse",
            "StartHeadLength": 3,
            "StartHeadWidth": 3,
            "EndHeadStyle": "cback2",
            "EndHeadLength": 7,
            "EndHeadWidth": 7,
            "Comments": "theme of the zoomed area"
        }

}

As you can see, there are four sections of configuration parameters:

  • subAxes (sub coordinate system)
  • zoomedArea (zoomed area)
  • dynamicRect (dynamic rectangle in the adjustment process)
  • connection (the line connecting the sub coordinate system and the zoomed area)

For example, the border of the zoomed area is changed to red, and the line width is changed to 3:

Another example, the color of the connecting line is changed to blue, the shape of the end arrow is changed to 'ellipse', and the line width is changed to 5:

TODO

  • Support for 3-D plots
  • Support for input of position parameters for sub coordinate system and zoomed area using a four-element vector of the form [left bottom width height]

Star History

Star History Chart

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.