Can the vertical axis of a plot be configured to have log log scaling?

Hello,
I’m trying to find software that can plot oil viscosities that follow something called the Walther Equation.
walther eq.jpg
This plots a straight line when the vertical axis is a double log scale.
This is the standard scaling applied to the ASTM D 341-17 chart for plotting viscosities.
Does this software have the ability to set up a vertical axis with this log log scaling?
Thanks for the help,
Andy
ASTM D341 plot.jpg
ASTM D341 plot 2.jpg

8 Comments

Hi Andy,
Would you like to plot 'gamma' or 'delta'? Also, got some sample data?
I would recommend looking at the log10 documentation which can be applied to matrices too: https://www.mathworks.com/help/matlab/ref/log10.html
I can send some data.
(See attached file)
X values are temperature in Kelvin.
Y values are viscostiy in cSt.
sample data 1.png
sample data 2.png
As you can see...the curve flattens out quite a bit going from linear scaling to log scaling.
It becomes a straight line when the vertical scale is manipulated further to be log log.
Thanks for pondering this!
(Not sure what gamma or delta means)
Thanks for sharing the data. You can use the semilogy command
semilogy(Sample20Data20for20plotting20viscosities2001NOV20191.K,Sample20Data20for20plotting20viscosities2001NOV20191.Viscosity);
Or for a log log plot you could just use the following:
plot(Sample20Data20for20plotting20viscosities2001NOV20191.K,log(log(Sample20Data20for20plotting20viscosities2001NOV20191.Viscosity)));
Also, I highly encourage using the Import tool, I used it to import your data from it url (https://www.mathworks.com/matlabcentral/answers/uploaded_files/246025/Sample%20Data%20for%20plotting%20viscosities%20(01NOV2019).xlsx) into a table
If is not asking too much, can you show how the data is ploted using this semilogy command?
While we have many seats of MatLAB here at JLG, I do not have it installed yet...nor am I skilled with the software. (But if it does what I need I'll go down that path).
As I note in another reply, it's importatnt that the values for the y axis remain in the actual cSt units. (centistokes). It looks as though semilogy is scaling the data rather than scaling the axis spacing.
Many thanks,
This plot is using semilogy(temp, viscosity) command:
plot_semilog.png
and using the plot(temp, log(log(viscosity)) command:
plot_loglog.png
and if you are curious to learn about some of the visualization and data analysis approaches, this is might be a useful (but 55 minute long) video https://www.mathworks.com/videos/matlab-for-excel-users-81634.html?s_tid=srchtitle
Thank you for taking the time to demonstrate this command. As I feared, the vertical data no longer corelates to the original viscosity value. What you've shown is useful for comparing slopes of lines, but not quite what I need for analyzing a specific fluid's temperature/viscosity performance.
I'll try to look at the video, though. Maybe there are other insights.
Thanks!

Sign in to comment.

Answers (1)

LL = log10(viscosity);
semilogy(x,LL);
??

3 Comments

Forgive me for not undertanding the syntax of the your reply. It's not a matter of just plotting any straight line...but plotting the straight line for this equation on scaling that is meaninful for discussion. It's imortant that one can read the graph and see the value in cSt (Centistokes).
I am not a user of Matlab...but trying to determine if this is the right software to use to accomplish this challenge in plotting vicsosity.
Can you elaborate? Or...perhaps demonstrate what you mean with a polot using the sample data from above? (If that's not asking too much)
Thank you kindly.
Was a solution to this problem found? I am trying to determine something similar.

Sign in to comment.

Asked:

on 1 Nov 2019

Commented:

on 21 Sep 2023

Community Treasure Hunt

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

Start Hunting!