Replies: 3 comments
-
You may know ogp actually calles gnuplot! So, would you please give a try directly in gnuplot! |
Beta Was this translation helpful? Give feedback.
-
The source of my problem is the option that is available in matlab contour which is vn in : ``contourf (x, y, z, vn)" "The optional input vn is either a scalar denoting the number of contour lines to compute or a vector containing the Z values where lines will be computed. When vn is a vector the number of contour lines is numel (vn). However, to compute a single contour line at a given value use vn = [val, val]. If vn is omitted it defaults to 10." I do not see that option vn available in ogpf function. |
Beta Was this translation helpful? Give feedback.
-
Yes, please first check the http://gnuplot.info/ Would you please check these pages: A good example is here: https://stackoverflow.com/a/57090231/439976 |
Beta Was this translation helpful? Give feedback.
-
I am trying to replicate matlab code with fortran. Matlab is using contourf feature which I can translate with ogpf library using contour funtion with fortran. Numerical data for (x,y,z) used for plot are the same, however the plots looks different. I realized that when color box are displayed, the range for z data or range of color in legend is different. For example, all z values are close to 1, matlab z range is from 0 to 2, while Fortran z range in color box is 0.99 to 1.01 So the obvious step is to change the color/z data range in Fortran. However, I do not see options listed/available to do that.
I tried the following,
call gp%axis([-1.0,+1.0,-2.0,+2.0,0,+2.0]) ! Sets all axis at same time
It does not work (for z data). I also tried the following,
call gp%xlim([-1.0,+1.0]) ! Sets only the xrange call gp%ylim([-2.0,+3.0]) ! Sets only the yrange call gp%zlim([0,+2.0]) ! Sets only the zrange
All these calls do not work.
Any suggestions?
Below is the test code for GNU Octave/Matlab
` figure 1;
%
% ------------------------------------------------------------------
% Use this example to test my problem with contourf plotting of data
% ------------------------------------------------------------------
%
%
%
%
% Create a vector of x values
x = linspace(-2pi,2pi,2);
% Create a vector of y values
y = linspace(0,4*pi,2);
% Make matrices with all combinations of x and y values for plotting
[X,Y] = meshgrid(x,y);
Z = sin(X)+cos(Y);
X
Y
Z
colormap ("default");
contourf(X,Y,Z)
title ({"Example 4: contourf() Z = sin(x) + cos(y) "});
colorbar ();
colorbar on;
`
This is a code in Fortran,
`subroutine problem111()
type(gpf):: gp
print*, " rank of x = ", rank(x)
print*, " rank of y = ", rank(y)
print*, " rank of z = ", rank(z)
print*, " x = ", x
print*, " y = ", y
print*, " z = ", z
end subroutine problem111`
Beta Was this translation helpful? Give feedback.
All reactions