Variance on a graph

6 views (last 30 days)
Laura T
Laura T on 10 Dec 2021
Hi Guys,
I am trying to plot the axis that has the greatest variance ontop of a graph i have previously coded for (eg from figure 1) as a new graph (eg figure 2). How do i do this?
And to plot an axis that is perpendicular to this axis ive just added?
  2 Comments
Voss
Voss on 10 Dec 2021
If you have done all the calculations already and need to know how to make a new figure to plot in, you can use the figure function:
figure(); % create a new figure window
% plot(x,y) % plot your stuff in the new figure window
I'm not sure what you have in mind for an axis that is perpendicular to another axis.
Perhaps some code you've tried (and some explanation about why it doesn't produce what you want) and/or a picture for reference (e.g., an image from the web or wherever of something similar to what you want to see) may help to clarify what you're looking for.
Michael Van de Graaff
Michael Van de Graaff on 10 Dec 2021
"I am trying to plot the axis that has the greatest variance...." I don't know what this means. presumably you do though, so i'll just assume you have some data you're trying to plot on an axes.
So now I proceed "I am trying to plot [data] ontop of a graph i have previously coded for" Ok, so you add some data to an exist plot, you must use hold() to preserve the already existing data.
Proceeding: "i'm trying to plot [data] ontop of a preexisting plot in figure 1 as a new plot in figure 2"..... what? are you trying to add data to a plot that already exists? if so then... that's not making a new figure, why are we discussing a new figure? I can't ansswer the question of how do you do this because I have no idea what you're trying to do.
"And to plot an axis that is perpendicular to this axis i've just added" I'm starting to think you have a plot with X and Y axes, and you want to add a third axis Z and have those two plots share the X axis or something?
I think Benjamin's suggestion for some code and an idea of what you want the result to look like would be helpful

Sign in to comment.

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!