Plot trace of figure

a.kk

I have 11 binary datasets and I would like to generate a graph with the trace of the corresponding figures of the data-sets (all 297x258) with the y-axis and x-axis multiplied with a scale of (1.3*10^(-6)) and labelled 'Y-axis(μm)' and 'X-axis (μm)' respectively. The 11 datasets are stored in a cell (i.e. data1{1},...data1{11}). Also if the plot can also label each trace with the name of the corresponding dataset it will be appreciated (i.e. data1{1},...).

The binary data

An example of the expected output: expected output

EBH

To plot this I start with finding the first non zero element in each column for all datasets, and then sum them up to plot the lines on top of each other.
Finally, I multiply the axis by the conversion constant you gave (raitio below) and change the format to meet your requested style:

data = reshape(cell2mat(data1),297,258,[]);
S = size(data);
fnzc = zeros(S([1 3])); % first non zero in column
for k = 1:S(3)
    csc = cumsum(data(:,:,k)>0,2); % on columns
    fnzc(:,k) = csc(:,end);
end
ratio = 1.3*(10^(-6));
ax = axes;
plot(ax,(S(1):-1:1)*ratio,cumsum(fnzc,2)*ratio)
ax.XAxis.TickLabelFormat = '%2d';
ax.XAxis.Exponent = -6;
ax.YAxis.TickLabelFormat = '%2d';
ax.YAxis.Exponent = -6;

And the result is:

trace figure

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to plot these two trace plots of `beta_1` in the same figure with a different color?

From Dev

Plot on the same figure in Matlab

From Dev

Multiple plot in the same figure

From Dev

Plot a figure and exit but leave figure window open

From Dev

Plot a figure and exit but leave figure window open

From Dev

In matlab, plot a heatmap and a line plot on the same figure

From Dev

In matlab, plot a heatmap and a line plot on the same figure

From Dev

Python Plot- Multiple the data in plot figure

From Dev

Plot figure problems with python and matplotlib

From Dev

multiple plot in one figure in Python

From Dev

Alignment of the Legend in Matlab Plot Figure

From Dev

mismatch between legend/figure in plot

From Dev

how to plot the figure as improfile shows

From Dev

Matlab, set font in figure plot

From Dev

PYMC decorators keywords meaning: trace, plot

From Dev

set title of a python `bokeh` plot figure from outside of the `figure()` function

From Java

Jupyter Notebook - Plot inside a function - Figure is not plotted

From Dev

Multiple plots on same figure with DataFrame.Plot

From Java

How to plot multiple functions on the same figure, in Matplotlib?

From Dev

AttributeError: 'Figure' object has no attribute 'plot'

From Dev

MATLAB - Plot multiple surface fits in one figure

From Dev

plot figure from a handle returned from a fucntion

From Dev

Plot two figures on the same figure using subplot

From Dev

Plot a big figure with many subfigures in matlab

From Dev

Changing Figure Size in Sympy.mpmath.plot

From Dev

How to plot multiple swarmplots in a single figure?

From Dev

Jupyter Notebook - Plot inside a function - Figure is not plotted

From Dev

MNIST plot first test figure after transform

From Dev

matplotlib figure without whitespace around plot

Related Related

  1. 1

    How to plot these two trace plots of `beta_1` in the same figure with a different color?

  2. 2

    Plot on the same figure in Matlab

  3. 3

    Multiple plot in the same figure

  4. 4

    Plot a figure and exit but leave figure window open

  5. 5

    Plot a figure and exit but leave figure window open

  6. 6

    In matlab, plot a heatmap and a line plot on the same figure

  7. 7

    In matlab, plot a heatmap and a line plot on the same figure

  8. 8

    Python Plot- Multiple the data in plot figure

  9. 9

    Plot figure problems with python and matplotlib

  10. 10

    multiple plot in one figure in Python

  11. 11

    Alignment of the Legend in Matlab Plot Figure

  12. 12

    mismatch between legend/figure in plot

  13. 13

    how to plot the figure as improfile shows

  14. 14

    Matlab, set font in figure plot

  15. 15

    PYMC decorators keywords meaning: trace, plot

  16. 16

    set title of a python `bokeh` plot figure from outside of the `figure()` function

  17. 17

    Jupyter Notebook - Plot inside a function - Figure is not plotted

  18. 18

    Multiple plots on same figure with DataFrame.Plot

  19. 19

    How to plot multiple functions on the same figure, in Matplotlib?

  20. 20

    AttributeError: 'Figure' object has no attribute 'plot'

  21. 21

    MATLAB - Plot multiple surface fits in one figure

  22. 22

    plot figure from a handle returned from a fucntion

  23. 23

    Plot two figures on the same figure using subplot

  24. 24

    Plot a big figure with many subfigures in matlab

  25. 25

    Changing Figure Size in Sympy.mpmath.plot

  26. 26

    How to plot multiple swarmplots in a single figure?

  27. 27

    Jupyter Notebook - Plot inside a function - Figure is not plotted

  28. 28

    MNIST plot first test figure after transform

  29. 29

    matplotlib figure without whitespace around plot

HotTag

Archive