Skip to main content

Stretch the dynamic range of the given 8-bit grayscale image using MATL...

How do I get smooth edges for a contourf plot on a log-log scale scatterplot?

 Hello,

 
I am having some trouble with using the contourf function on a log-log scale plot. I have 9 datapoints in a 2D scatterplot that are colored for a third variable. The code I use to plot the data as well as the plot are included below.
 
a = reshape(mtot_1,1,[]); % convert matrix to row vector
b = reshape(MFR_1,1,[]); % convert matrix to row vector
c = reshape(SN_maxes_1,1,[]); % convert matrix to row vector
figure(4)
clf
hold on
scatter(b, a, [], c, 'filled') 
set(gca,'xscale','log')
set(gca,'yscale','log')
colorbar
xlabel('MFR')
ylabel('total mass flow')

a-contourf-plot-on-a-log-log-scale-scatterplot

As you can see, on a log-log scale, the datapoits form a sort of "skewed quadrilateral" shape with edges that look "straight" when plotted on log-log. I want to create a contour map from these 9 points, but when I do, it looks like the plot below because the contour is generated with a linear interpolation method that creates straight lines between the points on a normal linear axis scale, which then look distorted or curved when plotted on the log-log scale. I have also included the code I use.

figure(5)
clf
hold on
contourf(MFR_1, mtot_1, SN_maxes_1, 100, 'LineStyle', 'none') 
scatter(b, a, [], c, 'filled') 
set(gca,'xscale','log')
set(gca,'yscale','log')
d = colorbar;
d.Label.String = "Swirl No.";
xlabel('MFR')
ylabel('total mass flow')

a-contourf-plot-on-a-log-log-scale-scatterplot

I would like to make it so that the contour plot has "straight" edges between the outer datapoints when plotted on the log-log scale, so that the contour map essentially appears as a quadrilateral with straight sides on the log-log plot instead of the odd curvy shape in the contour plot above. Can someone please offer me some advice as to how to achieve this? Thanks in advance!




 NOTE:-


Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

hello
 
I can suggest this , although I consider it needs some refinements
 
MFR_1 = [0.93016, 0.13933, 0.04154; 4.75072, 0.96454, 0.27638; 16.1767, 3.35929, 1.03684];
%Then the y-axis data (also a matrix): 
mtot_1 = [0.00087393, 0.001293, 0.00161739; 0.00146412, 0.00182395, 0.00211802; 0.00195069, 0.00228598, 0.002528465];
%Then the "z" data (if you would call it that). This is what determines the color of the dots.  It is also a matrix:
SN_maxes_1 = [1.678801, 1.627564, 1.521288; 1.535838, 1.848008, 1.7666569; 1.419559, 1.818278, 1.963394];
a = reshape(mtot_1,1,[]); % convert matrix to row vector
b = reshape(MFR_1,1,[]); % convert matrix to row vector
c = reshape(SN_maxes_1,1,[]); % convert matrix to row vector
figure(4)
clf
hold on
scatter(b, a, [], c, 'filled') 

% create a mesh with constant log spacing , and find points that are inside
% a polygon  (convex hull)
bl = log10(b');
al = log10(a');
cl = log10(c');
k = boundary(bl,al,1); % define outer hull 
xv = bl(k);
yv = al(k);
% plot(10.^xv, 10.^yv, '-r')

x = linspace(min(xv),max(xv),200);
y = linspace(min(yv),max(yv),200);
[X,Y] = meshgrid(x,y);
x = X(:);


Comments

Popular posts from this blog

https://journals.worldnomads.com/scholarships/story/70330/Worldwide/Dat-shares-his-photos-from-Bhutan https://www.blogger.com/comment.g?blogID=441349916452722960&postID=9118208214656837886&page=2&token=1554200958385 https://todaysinspiration.blogspot.com/2016/08/lp-have-look-at-this-this-is-from.html?showComment=1554201056566#c578424769512920148 https://behaviorpsych.blogspot.com/p/goal-bank.html?showComment=1554201200695 https://billlumaye.blogspot.com/2012/10/tagg-romney-drops-by-bill-show.html?showComment=1550657710334#c7928008051819098612 http://blog.phdays.com/2014/07/review-of-waf-bypass-tasks.html?showComment=1554201301305#c6351671948289526101 http://www.readyshelby.org/blog/gifts-of-preparedness/#comment_form http://www.hanabilkova.svet-stranek.cz/nakup/ http://www.23hq.com/shailendrasingh/photo/21681053 http://blogs.stlawu.edu/jbpcultureandmedia/2013/11/18/blog-entry-10-guns-as-free-speech/comment-page-1443/#comment-198345 https://journals.worldnomads.com

What are some good alternatives to Simulink?

Matlabsolutions provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. SIMULINK is a visual programing environment specially for time transient simulations and ordinary differential equations. Depending on what you need there are plenty of Free, Libre and Open Source Software (FLOSS) available: Modelica language is the most viable alternative and in my opinion it is also a superior option to MathWorks SIMULINK. There are open source implementations  OpenModelica  and  JModelica . One of the main advantages with Modelica that you can code a multidimensional ordinary differential equation with algebraic discrete non-causal equations. With OpenModelica you may create a non-causal model right in the GUI and with

USING MACHINE LEARNING CLASSIFICATION ALGORITHMS FOR DETECTING SPAM AND NON-SPAM EMAILS

    ABSTRACT We know the increasing volume of unwanted volume of emails as spam. As per statistical analysis 40% of all messages are spam which about 15.4 billion email for every day and that cost web clients about $355 million every year. Spammers to use a few dubious techniques to defeat the filtering strategies like utilizing irregular sender addresses or potentially add irregular characters to the start or the finish of the message subject line. A particular calculation is at that point used to take in the order rules from these email messages. Machine learning has been contemplated and there are loads of calculations can be used in email filtering. To classify these mails as spam and non-spam mails implementation of machine learning algorithm  such as KNN, SVM, Bayesian classification  and ANN  to develop better filtering tool.   Contents ABSTRACT 2 1. INTRODUCTION 4 1.1 Objective : 5 2. Literature Review 5 2.1. Existing Machine learning technique. 6 2.2 Existing