**Plot two graphs on same figure with two x-axes and one shared y-axis**I just wanted to plot two different functions, for simplicity let's say: 1. price in USA; and 2. price in India, as a function of weight. Now, I want this weight to be represented in pounds (popular in USA) as well as kilograms (popular in India), as two different x-axes, one on top of the graph while another on bottom of the graph. However, I want only single y-axis to compare the graphs of 'price in USA' and 'price in India'.
Is that possible in Matlab? I tried plotyy but it creates two y-axes for a single x-axis.
Any help is greatly appreciated. Thanks.
...

**one scatter plot with 2 x axis and 2 y axis, one of the x axis being a function of the first x axis**Hello to all!
I'm trying to do a Hertzsprung-Russell diagram like this one: http://en.wikipedia.org/wiki/File:HRDiagram.png
If you see, the temperature (top x axis) is not a linear function of the color (bottom x axis), and i cant find a way to do this.
My code:
% to read the stars data:
filename = 'Hipparcos_stars2.xlsx';
sheet1 = 1;
xHRcolor = 'G2:G19934';
yHRmag = 'I2:I19934';
xHRtemp = 'J2:J19934';
yHRlum = 'K2:K19934';
HRx_c = xlsread(filename, sheet1, xHRcolor);
HRy_m = xlsread(filename, sheet1, yHRmag);
HRx_t = 10.^(3.9396...

**2 y-axis plots on one plot**All,
I have 2 functions that share the same domain but have different
ranges
e.g.
f1(x) = function that outputs magnetic field (gauss)
f2(x) = function that outputs size (meters)
..
I've seen graphs where the left vertical axis is for one function, and
the right vertical axis is for the other. The domain (horizontal) axis
is the same for both. Is there a nice way to do this in Matlab?
Thanks!
On Jun 1, 3:41=A0pm, olsonaj <Abraham.Ol...@gmail.com> wrote:
> All,
>
> I have 2 functions that share the same domain but have different
> ranges
>
> e.g.
>
> f1(...

**Putting 2 graphs from 2 different m files into one plot**Hello,
I have some m Files (4 to be exact) each generates a semilog graph.
I want all 4 curves to appear on the same semilog graph
I cant just put all the code in one file because there are alot of common variables.
Thanks
"Shadi Philip" <shadi.phi@hotmail.com> wrote in message <gubv1p$aum$1@fred.mathworks.com>...
> Hello,
>
> I have some m Files (4 to be exact) each generates a semilog graph.
> I want all 4 curves to appear on the same semilog graph
>
> I cant just put all the code in one file because there are alot of common variables.
>
>...

**2 plot in one figure?**Hi folks;
I am trying to plot 2 figures in one figure. In MATLAB we have a
function named POLYY and we can plot 2 figures (2 Y) in one figure. I
want to plot this 2 plot in one figure in IDL whit different scale
first one is ordinary and second one logarithmic. Thanks for any help
in advance.
Cheers
Dav
On Nov 28, 8:09 am, d.po...@gmail.com wrote:
> Hi folks;
> I am trying to plot 2 figures in one figure. In MATLAB we have a
> function named POLYY and we can plot 2 figures (2 Y) in one figure. I
> want to plot this 2 plot in one figure in IDL whit different scale
> first one is...

**2 plots in one figure**Hi, I'm a beginner in matlab... can you tell me how to put a scatter
plot and function plot into one figure? Thanks
ushy wrote:
>
>
> Hi, I'm a beginner in matlab... can you tell me how to put a
> scatter
> plot and function plot into one figure? Thanks
Try the following
help plotyy
rf
ushy wrote:
> Hi, I'm a beginner in matlab... can you tell me how to put a scatter
> plot and function plot into one figure? Thanks
Use
% first plot
hold on;
% second plot
HTH
-rajeev-
Try the following:
figure
hold on;
grid on;
plot(xs,yx,'bx')
p...

**2 Graphs in one plot**Hi,
I want to plot 2 graphs (that depends on the same variable) in one plot
but with different scales for y, so plot "plot1", "plot2" is not
possible. The scales should appear on the left an right side of the
plot.
To explain what I want to do, here is a small example:
set multiplot
set border 3
set xtics nomirror
set ytics nomirror
plot [0:10] sin(x)
set logscale y2
unset ytics
set y2tics border nomirror
set border 9
plot [0:10] log(x)
unset multiplot
pause -1
The problem is, that the x-axis is not syncronized, because, the axis
labels are on dif...

**two plots in one figure #2**Dear Firends,
Sometimes i see a graph made by Matlabe that contains two
plots((This is not a subplot figure!)) by which i mean they
opened a figure; then they plot some data, and the put a
specific rage of data, let say zoom in a specific part of
graph, as a individual graph in the corner of figure!
Do you have any idea, how it possible?
Thanks
"karlo gonzales":
<SNIP plot-in-plot...
one of the many solutions
% the big guy
plot(rand(1,10));
% the little guy
axes('position',[.5,.5,.3,.3]);
line(1:10,rand(1,10));
box on;
us
...

**plotting 2 curves in one figure**hello all
i know I can use the hold on / all to plot 2 plots in one figure.
but what if I have a pre-defined function that plot for me. and the thing is that each time it is plotting it plots it on a new figure. is the ea way to plot it on a the same figure?
the function is:
function SpectrumAnalyzer(InputArray,Fs)
Yaxis=abs(fftshift(fft(InputArray)));
Yaxis=Yaxis.*Yaxis;
v=size(Yaxis);
if v(1)==1
V=size(Yaxis,2);
Xaxis=-Fs/2+Fs/V:Fs/V:(Fs/2);
else
V=v(1);
Xaxis=-Fs/2+Fs/V:Fs/V:(Fs/2);
Xaxis=Xaxis.';
end
Yaxis=10*log10(Yaxis*4/(V.*V));
% figure ------------> i actually chan...