Skip to content

Commit 17d3ac1

Browse files
rewrite README: offline-first quickstart, Octave support, gallery, badges
1 parent c38ee05 commit 17d3ac1

1 file changed

Lines changed: 59 additions & 22 deletions

File tree

README.md

Lines changed: 59 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,34 @@
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+
- Comparison gallery generator (`makegallery`) showing native and converted figures side by side
1424

1525
## Install
1626

17-
The latest version of the wrapper can be downloaded from [github](https://github.com/plotly/plotly_matlab/archive/master.zip).
27+
Download the latest version of the wrapper:
28+
29+
- [github.com/plotly/plotly_matlab/archive/master.zip](https://github.com/plotly/plotly_matlab/archive/master.zip)
30+
31+
Then, from the extracted folder, run:
1832

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')`
33+
```matlab
34+
plotlysetup_offline() % one-time setup: downloads and caches plotly.js for offline usage (requires internet once)
35+
```
2236

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

2539
## Usage
2640

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

29-
```MATLAB
43+
```matlab
3044
% Create some data for the two curves to be plotted
3145
x = 0:0.01:20;
3246
y1 = 200*exp(-0.05*x).*sin(x);
@@ -45,40 +59,63 @@ ylabel(ax(1), 'Low Frequency');
4559
ylabel(ax(2), 'High Frequency');
4660
4761
%--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'
62+
p = fig2plotly; % <-- converts the current figure to an interactive Plotly chart
5263
```
5364

5465
![Sample Plot](sample_plot.png)
5566

56-
Also, access other Plotly services and graphs programmatically. Like, publication-quality image export:
67+
The resulting figure is an interactive web chart: pan, zoom, hover, and download from the plotly.js toolbar.
68+
69+
## Static export
70+
71+
Export figures to publication-quality static images:
72+
73+
```matlab
74+
p = fig2plotly;
75+
saveplotlyfig(p, 'testimage.svg') % PNG, JPEG, PDF, and SVG supported
76+
```
77+
78+
## Online mode
79+
80+
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:
81+
82+
```matlab
83+
plotlysetup_online('your_username', 'your_api_key')
84+
```
5785

58-
```MATLAB
59-
saveplotlyfig(p, 'testimage.svg')
86+
## Retrieving figures
87+
88+
Fetch figures stored on the Plotly cloud:
89+
90+
```matlab
91+
p = getplotlyfig('chris', 1638) % downloads the graph data
6092
```
6193

62-
and Plotly figure retrieval:
6394

64-
```MATLAB
65-
p = getplotlyfig('chris', 1638) % downloads the graph data from https://plot.ly/~chris/1638
95+
## Gallery
96+
97+
Generate a side-by-side comparison of native and converted figures for over 80 plot types:
98+
99+
```matlab
100+
makegallery('OutputFolder', 'gallery')
66101
```
67102

68103
## Documentation
69104

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

72107
## Questions & troubleshooting
73108

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

76111
## Contribute
77112

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

80115
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.
81116

117+
The test suite (`plotly/testing/runplotlytests.m`) runs in both MATLAB and GNU Octave and is executed on every push via GitHub Actions.
118+
82119
## License
83120

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

0 commit comments

Comments
 (0)