Is it possible to import an image like the Hjulström-Diagramm and plot my data in it?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hey guys, I want to import an image like the Hjulström Diagramm (https://en.wikipedia.org/wiki/Hjulstr%C3%B6m_curve#/media/File:Hjulstr%C3%B6ms_diagram_en.PNG) in matlab and plot the data I have got from my experiments in it. Is there any function/tool or possibilty to realize this without designing/plotting everthing by myself? Tank you :) Regards)
댓글 수: 1
답변 (1개)
Naga
2025년 2월 26일
Hello david,
To overlay your experimental data on the Hjulström diagram in MATLAB, you can follow the approach you've outlined. Here are the steps:
- Use 'imshow' to display the image, and adjust the axes to match the scale of the diagram.
- Overlay your experimental data points on the diagram.
Attaching the code for the same:
img = imread('Hjulströms_diagram_en.png'); % Ensure the filename and path are correct
figure;
% Display the image with specified axis limits
imshow(img, 'XData', [0.01, 1000], 'YData', [0.01, 100]);
hold on;
% Set the axis properties
ax = gca;
set(ax, 'YDir', 'reverse'); % Reverse Y-axis to match the image's orientation
set(ax, 'XScale', 'log'); % Use log scale for X-axis
set(ax, 'YScale', 'log'); % Use log scale for Y-axis
% Set axis limits based on the diagram's expected range
xlim([0.01, 1000]); % Adjust X-axis limits (e.g., sediment size in mm)
ylim([0.01, 1000]); % Adjust Y-axis limits (e.g., velocity in cm/s)
% Example experimental data (replace with your own data)
sediment_size = [0.1, 1, 10]; % x values
velocity = [5, 20, 50]; % y values
% Plot the data on top of the image
plot(sediment_size, velocity, 'ro', 'MarkerSize', 8, 'MarkerFaceColor', 'r');
hold off;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!