Filter löschen
Filter löschen

Add multiple y axes to a plot

11 Ansichten (letzte 30 Tage)
Cliff Karlsson
Cliff Karlsson am 17 Sep. 2018
Beantwortet: Adam Danz am 17 Sep. 2018
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)

Antworten (1)

Adam Danz
Adam Danz am 17 Sep. 2018
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.

Kategorien

Mehr zu Two y-axis finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by