Plot Xy Graph
Display X-Y plot of signals using MATLAB figure window
Description
The XY Graph block displays an X-Y plot of its inputs in a MATLAB® figure window.
The block has two scalar inputs. The block plots data from the first input (the x direction) against data from the second input (the y direction). (See Port Location After Rotating or Flipping for a description of the port order for various block orientations.) This block is useful for examining limit cycles and other two-state data. Data outside the specified range does not appear.
A figure window appears for each XY Graph block in the model at the start of simulation.
Create charts and graphs online with Excel, CSV, or SQL data. Make bar charts, histograms, box plots, scatter plots, line graphs, dot plots, and more. Free to get started! Free graphing calculator instantly graphs your math problems. Visit Mathway on the web. Download free on Google Play. Download free on iTunes. Download free on Amazon. Download free in Windows Store. Works with a wide variety of charts (XY, bar, polar, ternary, maps etc.) Automatic extraction algorithms make it easy to extract a large number of data points; Free to use, opensource and cross-platform (web and desktop) Used in hundreds of published works by thousands of users; Also useful for measuring distances or angles between various features.
- XY scatter plot with markers of varying size and/or color (sometimes also called bubble chart).
- Complete the following steps to display an array of points on a single-plot XY graph. Add an XY graph to the front panel. Build a block diagram with the following objects: Divide function; Multiply function; Sine function; Bundle function; For Loop around all objects on the block diagram except the XY graph terminal; Wire the x/y output of the.
Note
The XY Graph block does not support stepping back in a simulation.
Input
Plot input as x values on an X-Y plot. See Port Location After Rotating or Flipping for a description of the port order for various block orientations.
Data Types: single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
Boolean
fixed point
Plot input as y values on an X-Y plot. See Port Location After Rotating or Flipping for a description of the port order for various block orientations.
Data Types: single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
Boolean
fixed point
Parameters
Specify the minimum x-axis value. Data below the minimum x is ignored.
Programmatic Use
Block Parameter:xmin |
Type: character vector |
Values: real number |
Default:'-1' |
Specify the maximum x-axis value. Data above the maximum x is ignored.
Programmatic Use
Block Parameter:xmax |
Type: character vector |
Values: real number |
Default:'1' |
Specify the minimum y-axis value. Data below the minimum y is ignored.
Programmatic Use
Block Parameter:ymin |
Type: character vector |
Values: real number |
Default:'-1' |
Specify the maximum y-axis value. Data above the maximum y is ignored.
Programmatic Use
Block Parameter:ymax |
Type: character vector |
Values: real number |
Default:'1' |
Sample time
— Sample time
-1
(default) positive number
Specify the time interval between samples. To inherit the sample time, set this parameter to -1
. For more information, see Specify Sample Time.
Programmatic Use
Block Parameter:st |
Type: character vector |
Values:'-1' (for inherited) positive number |
Default:'-1' |
Model Examples
Plots a circle in Simulink using an XY Graph block.
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Plot Graph
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
This block can be used for simulation visibility in systems that generate code, but is not included in the generated code.
HDL Code Generation
Generate Verilog and VHDL code for FPGA and ASIC designs using HDL Coder™.
This block can be used for simulation visibility in subsystems that generate HDL code, but is not included in the hardware implementation.
PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.
Plot Xy Graph
This block can be used for simulation visibility in systems that generate PLC code, but is not included in the generated code.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
This block accepts fixed-point input, but converts it to double
for display.
See Also
Topics
- Get Started with ROS in Simulink® (ROS Toolbox)
Description :: All Functions
Enter an Equation using the variables x and/or y and an =, press Go:
Description
It can plot an equation where x and y are related somehow (not just y=...), like these:
Examples:
- x^2+y^2=9 (an equation of a circle with a radius of 3)
- sin(x)+cos(y)=0.5
- 2x-3y=1
- cos(x^2)=y
- (x-3)(x+3)=y^2
- y=x^2
If you don't include an equals sign, it will assume you mean '=0'
It has not been well tested, so have fun with it, but don't trust it.
If it gives you problems, let me know.
Note: it may take a few seconds to finish, because it has to do lots of calculations.
Graph Plotting Tool
If you just want to graph a function in 'y=...' style you may prefer Function Grapher and Calculator
Zooming
Use the zoom slider (to the left zooms in, to the right zooms out).
To reset the zoom to the original bounds click on the Reset button.
Dragging
Click-and-drag to move the graph around. If you just click-and-release (without dragging), then the spot you clicked on will be the new center
Note: the plots use computer calculations. Round-off can cause errors or values can be missed completely.
All Functions
Operators
Plot Xy Graph Python
+ | Addition operator |
---|---|
- | Subtraction operator |
* | Multiplication operator |
/ | Division operator |
^ | Exponent (Power) operator |
Functions
sqrt | Square Root of a value or expression. |
---|---|
sin | sine of a value or expression |
cos | cosine of a value or expression |
tan | tangent of a value or expression |
asin | inverse sine (arcsine) of a value or expression |
acos | inverse cosine (arccos) of a value or expression |
atan | inverse tangent (arctangent) of a value or expression |
sinh | Hyperbolic sine (sinh) of a value or expression |
cosh | Hyperbolic cosine (cosh) of a value or expression |
tanh | Hyperbolic tangent (tanh) of a value or expression |
exp | e (the Euler Constant) raised to the power of a value or expression |
ln | The natural logarithm of a value or expression |
log | The base-10 logarithm of a value or expression |
floor | Returns the largest (closest to positive infinity) value that is not greater than the argument and is equal to a mathematical integer. |
ceil | Returns the smallest (closest to negative infinity) value that is not less than the argument and is equal to a mathematical integer. |
round | Round to the nearest integer. Examples: round(-2.5) = -2, round(-0.1) = 0, round(0.1) = 0, round(2.5) = 3 |
abs | Absolute value (distance from zero) of a value or expression |
sign | Sign (+1 or -1) of a value or expression |
Constants
pi | The constant π (3.141592654...) |
---|---|
e | Euler's number (2.71828...), the base for the natural logarithm |