RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • addpoints
    • ancestor
    • animatedline
    • area
    • axes
    • axis
    • bar
    • barh
    • box
    • caxis
    • cla
    • clf
    • clim
    • colorbar
    • colorcube
    • colormap
    • colororder
    • contour
    • contour3
    • contourf
    • copyobj
    • daspect
    • datacursormode
    • dataTipTextRow
    • errorbar
    • fcontour
    • figure
    • fill
    • fill3
    • findobj
    • fsurf
    • gca
    • gcf
    • get
    • gobjects
    • grid
    • groot
    • heatmap
    • hgload
    • hgsave
    • hidden
    • hist
    • histogram
    • histogram2
    • hold
    • image
    • imagesc
    • imshow
    • legend
    • line
    • linkaxes
    • loglog
    • mesh
    • meshc
    • openfig
    • opengl
    • pan
    • parula
    • patch
    • pie
    • plot
    • plot3
    • plotmatrix
    • plotyy
    • polarhistogram
    • polarplot
    • polarscatter
    • print
    • quiver
    • quiver3
    • ribbon
    • saveas
    • savefig
    • scatter
    • scatter3
    • semilogx
    • semilogy
    • set
    • sgtitle
    • shading
    • sphere
    • stackedplot
    • stairs
    • stem
    • subplot
    • subtitle
    • suptitle
    • surf
    • surfc
    • text
    • textscatter
    • textscatter3
    • title
    • triplot
    • view
    • waitbar
    • wordcloud
    • xlabel
    • xlim
    • xline
    • xscale
    • xtickangle
    • xtickformat
    • xticklabels
    • xticks
    • ylabel
    • ylim
    • yline
    • yscale
    • ytickangle
    • ytickformat
    • yticklabels
    • yticks
    • zlabel
    • zlim
    • zoom

plotyy — Plot two data sets with independent left and right Y axes.

plotyy creates two overlaid Cartesian axes in the current figure, plots the first data set against the left Y axis, plots the second data set against the right Y axis, and returns the axes and line handles. It is a legacy MATLAB compatibility helper; new MATLAB code generally uses yyaxis.

Syntax

[ax,h1,h2] = plotyy(X1,Y1,X2,Y2)
[ax,h1,h2] = plotyy(X1,Y1,X2,Y2,fun)
[ax,h1,h2] = plotyy(X1,Y1,X2,Y2,fun1,fun2)

Inputs

NameTypeRequiredDefaultDescription
X1NumericArrayYes—X data for the left axes.
Y1NumericArrayYes—Y data for the left axes.
X2NumericArrayYes—X data for the right axes.
Y2NumericArrayYes—Y data for the right axes.
argsAnyVariadic—X1, Y1, X2, Y2 followed by one plotting function selector.
argsAnyVariadic—X1, Y1, X2, Y2 followed by left and right plotting function selectors.

Returns

NameTypeDescription
axNumericArrayTwo axes handles [left right].
h1NumericArrayLine handle or handles for the left axes.
h2NumericArrayLine handle or handles for the right axes.

Returned values from plotyy depend on how many outputs the caller requests.

Errors

IdentifierWhenMessage
RunMat:plotyy:InvalidArgumentInput count, plotting function selector, or line data is invalid.plotyy: invalid argument
RunMat:plotyy:InternalInternal plotting state update fails.plotyy: internal operation failed

GPU memory and residency

plotyy is a plotting sink. It delegates line creation to the existing low-level line path, so GPU-resident inputs follow the same residency behavior as line and are not gathered by plotyy itself.

Examples

Plot two series with separate Y axes

[ax,h1,h2] = plotyy(1:3, [10 20 30], 1:3, [100 400 900]);
get(ax(2), 'YAxisLocation')

Expected output:

right

Use logarithmic plotting functions

[ax,h1,h2] = plotyy(1:3, [10 20 30], 1:3, [100 400 900], 'semilogx', 'semilogy');
{get(ax(1),'XScale'), get(ax(2),'YScale')}

Expected output:

{'log', 'log'}

Using plotyy with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how plotyy changes the result.

Run a small plotyy example, explain the result, then change one input and compare the output.

Related Plotting functions

2D Charts

area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem

3D & Surface

contour · contour3 · contourf · mesh · meshc · plot3 · quiver · scatter3 · surf · surfc

Images

image · imagesc · imshow

Axes & Layout

axis · box · grid · sgtitle · subplot · title · view · zlabel

Appearance

colorbar · colormap · legend · shading

Handle Access

gca · gcf · get · set

Other

addpoints · ancestor · animatedline · axes · barh · caxis · cla · clf · clim · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill · fill3 · findobj · fsurf · gobjects · groot · hgload · hgsave · hidden · histogram2 · hold · line · linkaxes · openfig · opengl · pan · parula · patch · plotmatrix · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · stackedplot · subtitle · suptitle · text · textscatter · textscatter3 · triplot · waitbar · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • GPU memory and residency
  • Examples
  • Plot two series with separate Y axes
  • Use logarithmic plotting functions
  • Using plotyy with coding agents
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • About RunMat