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!