Add multiple y axes to a plot

11 次查看(过去 30 天)
Cliff Karlsson
Cliff Karlsson 2018-9-17
回答: Adam Danz 2018-9-17
How can I add several y-axes to the following plot? I want one y-axis for each data category (MPG, Horsepower...) that is also scaled to each categories max value.
clear
load carbig.mat
colors = [[0 0 0]; [0 0 0]; [1 0 0]; [0 1 0]; [1 0.5 0]; [1 0 1]; [0 0 0]; [0 0 1]];
data = [MPG Horsepower Weight Acceleration Displacement Cylinders*500];
labels = {'MPG', 'Horsepower', 'Weight', 'Acceleration', 'Displacement', 'Cylinders'};
lineobjects = parallelcoords(data, 'Labels',labels)

回答(1 个)

Adam Danz
Adam Danz 2018-9-17
plotyy() creates a plot using the left and right axes. To have more than 2 axes, start by reading this blog by Loren. In addition to those resources, I'll add another option and that is to overlay a transparent axis the same size and location as your main axis. That gives you two more y axes where you can apply the plotyy() function.

类别

Help CenterFile Exchange 中查找有关 Two y-axis 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by