Effacer les filtres
Effacer les filtres

Add multiple y axes to a plot

11 vues (au cours des 30 derniers jours)
Cliff Karlsson
Cliff Karlsson le 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)

Réponses (1)

Adam Danz
Adam Danz le 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.

Catégories

En savoir plus sur Two y-axis dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by