Skip to content

Commit f7a2fbf

Browse files
rewrite README: offline-first quickstart, Octave support, themes, gallery, badges
1 parent 8f90fb4 commit f7a2fbf

1 file changed

Lines changed: 68 additions & 22 deletions

File tree

README.md

Lines changed: 68 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Plotly Graphing Library for MATLAB®
1+
# Plotly Graphing Library for MATLAB® and GNU Octave
22

3-
> Plotly Graphing Library for MATLAB® - Create interactive charts in your web browser with MATLAB® and Plotly
3+
[![CI](https://github.com/plotly/plotly_matlab/actions/workflows/ci.yml/badge.svg)](https://github.com/plotly/plotly_matlab/actions/workflows/ci.yml)
4+
[![Release](https://img.shields.io/github/v/release/plotly/plotly_matlab)](https://github.com/plotly/plotly_matlab/releases)
5+
6+
> Create interactive, web-based charts in your browser from MATLAB® and GNU Octave.
47
58
<div align="center">
69
<a href="https://dash.plotly.com/project-maintenance">
@@ -10,23 +13,35 @@
1013

1114
Version: 3.1.0
1215

13-
*MATLAB is a registered trademarks of The MathWorks, Inc.*
16+
*MATLAB is a registered trademark of The MathWorks, Inc.*
17+
18+
## Features
19+
20+
- Convert native MATLAB and GNU Octave figures to interactive [Plotly](https://plotly.com) charts with a single line of code
21+
- Fully offline: charts render locally in your browser — plotly.js is downloaded once during setup and cached on your machine
22+
- Publication-quality static export (PNG, JPEG, PDF, SVG) via the Kaleido runtime (downloaded once during setup)
23+
- Ten switchable chart themes (Plotly dark, ggplot2, seaborn, and more)
24+
- Comparison gallery generator (`makegallery`) showing native and converted figures side by side
1425

1526
## Install
1627

17-
The latest version of the wrapper can be downloaded from [github](https://github.com/plotly/plotly_matlab/archive/master.zip).
28+
Download the latest version of the wrapper:
1829

19-
Once downloaded, run `plotlysetup_offline()` to get started.
20-
If you have a plotly bundle url of the form '<http://cdn.plot.ly/plotly-latest.min.js>', then run instead
21-
`plotlysetup_offline('plotly_bundle_url')`
30+
- [github.com/plotly/plotly_matlab/archive/master.zip](https://github.com/plotly/plotly_matlab/archive/master.zip)
31+
32+
Then, from the extracted folder, run:
33+
34+
```matlab
35+
plotlysetup_offline() % one-time setup: downloads and caches plotly.js for offline usage (requires internet once)
36+
```
2237

23-
For online use, run `plotlysetup_online('your_username', 'your_api_key')` to get started.
38+
This works in both MATLAB and GNU Octave.
2439

2540
## Usage
2641

27-
Convert your MATLAB® figures into online [Plotly](https://plot.ly) graphs with a single line of code:
42+
Convert your MATLAB® or Octave figure into an interactive Plotly chart with a single line of code:
2843

29-
```MATLAB
44+
```matlab
3045
% Create some data for the two curves to be plotted
3146
x = 0:0.01:20;
3247
y1 = 200*exp(-0.05*x).*sin(x);
@@ -45,40 +60,71 @@ ylabel(ax(1), 'Low Frequency');
4560
ylabel(ax(2), 'High Frequency');
4661
4762
%--PLOTLY--%
48-
p = fig2plotly; % <-- converts the yy-plot to an interactive, online version.
49-
50-
%--URL--%
51-
% p.url = 'https://plot.ly/~matlab_user_guide/1522'
63+
p = fig2plotly; % <-- converts the current figure to an interactive Plotly chart
5264
```
5365

5466
![Sample Plot](sample_plot.png)
5567

56-
Also, access other Plotly services and graphs programmatically. Like, publication-quality image export:
68+
The resulting figure is an interactive web chart: pan, zoom, hover, and download from the plotly.js toolbar.
69+
70+
## Static export
71+
72+
Export figures to publication-quality static images:
5773

58-
```MATLAB
59-
saveplotlyfig(p, 'testimage.svg')
74+
```matlab
75+
p = fig2plotly;
76+
saveplotlyfig(p, 'testimage.svg') % PNG, JPEG, PDF, and SVG supported
6077
```
6178

62-
and Plotly figure retrieval:
79+
## Online mode
6380

64-
```MATLAB
65-
p = getplotlyfig('chris', 1638) % downloads the graph data from https://plot.ly/~chris/1638
81+
Offline usage is the default and requires nothing. For online features — storing charts on the Plotly cloud, retrieving figures with `getplotlyfig`, and streaming — configure your Plotly credentials:
82+
83+
```matlab
84+
plotlysetup_online('your_username', 'your_api_key')
85+
```
86+
87+
## Retrieving figures
88+
89+
Fetch figures stored on the Plotly cloud:
90+
91+
```matlab
92+
p = getplotlyfig('chris', 1638) % downloads the graph data
93+
```
94+
95+
## Themes
96+
97+
Switch between ten built-in chart themes:
98+
99+
```matlab
100+
p = fig2plotly;
101+
addtheme(p, 'plotly_dark') % or: ggplot2, seaborn, plotly_white, presentation, ...
102+
```
103+
104+
## Gallery
105+
106+
Generate a side-by-side comparison of native and converted figures for over 80 plot types:
107+
108+
```matlab
109+
makegallery('OutputFolder', 'gallery')
66110
```
67111

68112
## Documentation
69113

70-
This lives here: [https://plot.ly/matlab](https://plot.ly/matlab)
114+
- [plotly.com/matlab](https://plotly.com/matlab) - official documentation
71115

72116
## Questions & troubleshooting
73117

74-
Ask on the [Plotly Community Forum](https://community.plotly.com/c/plotly-r-matlab-julia-net)
118+
Ask on the [Plotly Community Forum](https://community.plotly.com/c/plotly-r-matlab-julia-net).
75119

76120
## Contribute
77121

78122
Please do! This is an open source project. Check out [the issues](https://github.com/plotly/plotly_matlab/issues) or open a PR!
79123

80124
We want to encourage a warm, welcoming, and safe environment for contributing to this project. See the [code of conduct](CODE_OF_CONDUCT.md) for more information.
81125

126+
The test suite (`plotly/testing/runplotlytests.m`) runs in both MATLAB and GNU Octave and is executed on every push via GitHub Actions.
127+
82128
## License
83129

84130
[MIT](LICENSE) © Plotly, Inc.

0 commit comments

Comments
 (0)