Plotting vertical line with specified color

2 Ansichten (letzte 30 Tage)
Marc Laub
Marc Laub am 20 Feb. 2022
Beantwortet: Abhishek Chakram am 19 Dez. 2023
Hey,
I want to visualize the development of a distribution over time.
Therefore I want to plot the distribution of the diameter on the y axis and the time on the x axis, while the probability of the diameter on the y acis is color coded for each time. A quick and dirty example of what I wanna do is shown below, where red stnds for normalized highest probability and blue for zero, in the black area no datapoints are available.
The problem is that I do not have the distribution data for every point on the x xis, just for distinctive points in time.
So there are 2 questions:
Would I realize this with an iage plot, like shown= In this case I would need the make the pixelns on the x axis not linear but relative to my distinctive time steps (not sure how)
Or would I realize it with a plot, with the disadnavntage of not having data for each x point, so there would be much blank space which looke weid and I would need to interpolate my distribution along the x axis, not sure how this shoud be done. Interpolating µ and sigma might lead to error swhen the distribution changes from mono- to bimodal which cant be seen here due to the used spectra, gues i would need to change also tge colorscale so that also little probabiliies can be distinguised from the background. Maybe more luminescence coded instead of color?
So is it possible to change pixel.x scale to distininctive values (close to log scale, but not exactly, or is it possible to interpolate hisogram data that do not suffer from the loss of information due to fitting the distribution? And if lter is possible how to plot vertical line where the color on each y point has a color given by a vector?
Many thanks in advance,
best regards

Antworten (1)

Abhishek Chakram
Abhishek Chakram am 19 Dez. 2023
Hi Marc Laub,
It is my understanding that you want to visualize the development of a distribution over time with distinctive points in time. Here are few options for the same:
  • Interpolate the data in both time and diameter dimensions: This approach involves interpolating the data to create a continuous representation of distribution over time using “interp2” function. After interpolation, the data is displayed using “imagesc” or “pcolor” with a custom “colormap” to represent the probability.
  • Use a series of line plots: Another approach is to plot each distribution as a line plot where the line color represents the probability. This would not require interpolation, but it may not give you a continuous image-like representation.
You can refer to the following documentation to know more about the functions used:
Best Regards,
Abhishek Chakram

Kategorien

Mehr zu Orange finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by