Info

此问题已关闭。 请重新打开它进行编辑或回答。

how create plot with 3 dataset of same parameter across the depth

1 次查看(过去 30 天)
Hello everyone,
I need to plot 3 dataset of same parameter (aragonite saturation) on X axes and depth on Y axes.
How could I do it?
Thank you very much!
  4 个评论
Sai Bhargav Avula
Sai Bhargav Avula 2019-12-3
Can you explain what intersect the DEPTH data of my 3 datasets mean. Does it mean solving the curve that the datasets fits in.
What plot do you want to use (eg. scatter, plot)? Also what do mean by vertical plot (is it like a 3D histogram).
Sofia Stella
Sofia Stella 2019-12-3
编辑:Sofia Stella 2019-12-3
I put some examples to show you why the depth data are different in 3 datasets (they have not same levels and i can't unify them together):
As you can see from 3 datasets i have 3 different levels of depth, but I need same levels, and I need SCATTER PLOT , so a 2d plot with dots, of the aragonite across the depth (vertical I mean from surface of water, 0meters, to the bottom).

回答(1 个)

Sai Bhargav Avula
Sai Bhargav Avula 2019-12-3
编辑:Sai Bhargav Avula 2019-12-3
Hi,
With the data you provided, I understand that you have data of different dimensions (In this case different depth values and the number stations).
The data has several NaN values which needs to be handled. A possible work around would be extracting each row and use the rmmissing to remove the missing data at each station for all the 3 datasets.
Then you can either use a interp1 to interpolate all the 3 datasets depths values at a particular station to the desired number of depth values. Or truncated the depth values to the minimum of all the 3 datasets at a particular dataset. Then use the scatter plot to plot the data
Hope this helps!
  2 个评论
Sofia Stella
Sofia Stella 2019-12-3
编辑:Sofia Stella 2019-12-3
That's cool!
But, if I use rmmissing this eliminates all the rows and get my assay a vector (I obtain just 2 rows instead originally 31).
Which function is better for a matrix?
Do you suggest me to use logical array?
I'm not so practical about the program, is not so simple to me.
Thank you very much
Sai Bhargav Avula
Sai Bhargav Avula 2019-12-3
Since you need to plot the depth anyway, As suggested earlier I would recommend you to extract each row(meaning at each station) and work use rmmissing over it(As you need to again interpolate to match the dimensions of all the 3 datasets at that particular station).
Considering the entire flow that needs to be done. I think this way would help you.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by