Comments (1)
That error you report is caused by MATLAB but not by matlab_plotly
. This is because you are not using the MATLAB legend
function correctly. You are passing the parameters wrong when you invoke legend
.
Since you have a single plot line, you can only pass one label in legend
, which would be 'Data'
or 'Slope'
or 'Slope & Intersection'
. But you can't go through three because the chart doesn't have three traces.
The correct use would be the following
load accidents
x = hwydata(:,14) %Population of states
y = hwydata(:,4) %Accidents per state
X = [ones(length(x),1) x];
b = X\y;
yCalc2 = X*b
plot(x,yCalc2,'--');
legend({'Data'},'Location','best');
fig2plotly(gcf);
result will be
Data+Slope
If you want to plot both the data and the slope, you need to do the following
load accidents
x = hwydata(:,14) %Population of states
y = hwydata(:,4) %Accidents per state
X = [ones(length(x),1) x];
b = X\y;
yCalc2 = X*b
plot(x,y,'o');
hold on
plot(x,yCalc2,'--');
legend({'Data', 'Slope'},'Location','best');
fig2plotly(gcf);
from plotly_matlab.
Related Issues (20)
- docs - coneplot problems
- docs - bubblecloud not implemented
- docs - surfl access does not work
- docs - pie3 subplot legend not properly captured
- docs - 3d line problems HOT 1
- docs - 3d histogram colors not working HOT 1
- docs - parallerplot not implemented
- docs - pie3 subplot's legend wrongly captured HOT 1
- docs - polarplot/polarscatter/polarbubblechart problems
- docs - tsuf special characters in legend not translated
- docs - time series (stackedplot) not implemented HOT 1
- docs - scatter3 - legend and axis proportions not captured HOT 1
- docs - quiver 3 problem HOT 1
- docs - errorbar plot HOT 1
- [solved] fix the figure title with </b> tag behind
- Ability to support group hierarchy (nested groups) for all IdPs HOT 1
- plotlysetup_online() command returns error HOT 1
- getplotlyfig() Error
- Latex math in html file not rendering in browser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotly_matlab.