axis text do not plot

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

axis text do not plot

bjkvamme
load hyd3D

x3=hyd3D(:,12)
y3=hyd3D(:,1)
z3=hyd3D(:,11)
xv = linspace(min(x3), max(x3), 1000);
yv = linspace(min(y3), max(y3), 1000);
[X,Y] = meshgrid(xv, yv);
Z = griddata(x3, y3, z3, X, Y);

meshc(X,Y,Z,"facecolor", "k")

xlabel ("Delta x",'Color',"k",'fontsize',10)
ylabel ("T (K)",'Color','k','fontsize',10)            
zlabel ("Diff. (kJ/mole)",'Color','k','fontsize',10)            
set(gca,'fontsize',10)  
grid on    

<https://octave.1599824.n4.nabble.com/file/t373972/image_2021-05-02_132229.png>



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



Reply | Threaded
Open this post in threaded view
|

Re: axis text do not plot

nrjank
Administrator


On Sun, May 2, 2021 at 9:54 AM bjkvamme <[hidden email]> wrote:
load hyd3D


I'm unable to reproduce your results. Obviously I don't have the starting dataset (hyd3D). but if I try to produce a meshc with a dummy dataset, and then follow the meshc with your annotation commands, I get results that show the axis labels. 

[X, Y] = meshgrid (linspace (-3, 3, 40));
Z = sqrt (abs (X .* Y)) ./ (1 + X.^2 + Y.^2);
meshc (X, Y, Z);
xlabel ("Delta x",'Color',"k",'fontsize',10)
ylabel ("T (K)",'Color','k','fontsize',10)          
zlabel ("Diff. (kJ/mole)",'Color','k','fontsize',10)          
set(gca,'fontsize',10)
grid on  

What version of Octave, operating system, and graphics toolkit are you running?     (type graphics_toolkit at the command line).  Can you try the plot using other toolkits?  

graphics_toolkit('qt')
graphics_toolkit('fltk')  
graphics_toolkit('gnuplot')  

and see if you get the same or different results?  On my system (Octave 6.2.0 on windows) i get the same results showing axis labels using all three with all three toolkits, but it might help us determine what's causing your error.
 


Reply | Threaded
Open this post in threaded view
|

Re: axis text do not plot

bjkvamme
Thank you very much for the reply Nicholas



Here is the datafile enclosed 

Best regards,
Bjørn

man. 3. mai 2021 kl. 14:14 skrev Nicholas Jankowski <[hidden email]>:


On Sun, May 2, 2021 at 9:54 AM bjkvamme <[hidden email]> wrote:
load hyd3D


I'm unable to reproduce your results. Obviously I don't have the starting dataset (hyd3D). but if I try to produce a meshc with a dummy dataset, and then follow the meshc with your annotation commands, I get results that show the axis labels. 

[X, Y] = meshgrid (linspace (-3, 3, 40));
Z = sqrt (abs (X .* Y)) ./ (1 + X.^2 + Y.^2);
meshc (X, Y, Z);
xlabel ("Delta x",'Color',"k",'fontsize',10)
ylabel ("T (K)",'Color','k','fontsize',10)          
zlabel ("Diff. (kJ/mole)",'Color','k','fontsize',10)          
set(gca,'fontsize',10)
grid on  

What version of Octave, operating system, and graphics toolkit are you running?     (type graphics_toolkit at the command line).  Can you try the plot using other toolkits?  

graphics_toolkit('qt')
graphics_toolkit('fltk')  
graphics_toolkit('gnuplot')  

and see if you get the same or different results?  On my system (Octave 6.2.0 on windows) i get the same results showing axis labels using all three with all three toolkits, but it might help us determine what's causing your error.
 



hyd3D (22K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: axis text do not plot

nrjank
Administrator
On Mon, May 3, 2021 at 9:00 AM Bjørn Kvamme <[hidden email]> wrote:
Thank you very much for the reply Nicholas

Here is the datafile enclosed 


 and the results regarding your versions and the results of graphics_toolkit and trying other toolkits?



Reply | Threaded
Open this post in threaded view
|

Re: axis text do not plot

nrjank
Administrator
On Mon, May 3, 2021 at 10:58 AM Nicholas Jankowski <[hidden email]> wrote:
On Mon, May 3, 2021 at 9:00 AM Bjørn Kvamme <[hidden email]> wrote:
Thank you very much for the reply Nicholas

Here is the datafile enclosed 


 and the results regarding your versions and the results of graphics_toolkit and trying other toolkits?


ok, absent any more details about what is actually happening on your end, here's my guess:

Octave seems to not currently support the facecolor option passed to meshc in this way.  It may be a bug, not sure.  Matlab seems to allow it and the color gets passed to the underlying surface object as the help suggests it should. Octave seems to try to assign that property to the 'property group' that meshc creates, and a group doesn't get a facecolor.  in any case, even in matlab setting the facecolor of the underlying surface object doesn't seem to change appearance at all.

in any case, you failed to mention whether you get an error when running the meshc command, which I now see. it appears that this error interrupts proper handling of the graphics properties.  subsequent calls to xlabel, etc. are then unpredictable.  when running gnuplot as your graphics toolkit (which is again my best guess of what you're doing) this appears to break the ability to do follow-on labels, etc., altogether. with qt or fltk, I'm still able to apply labels.

best immediate fix:  switch from gnuplot to qt, and drop the facecolor statement. i'll see if it warrants a bug report on the facecolor issue.


Reply | Threaded
Open this post in threaded view
|

Re: axis text do not plot

nrjank
Administrator
On Wed, May 5, 2021 at 3:54 AM Bjørn Kvamme <[hidden email]> wrote:
I have some other problems. Octave will not plot this file

load dynam

x2=dynam(:,1)
y2=dynam(:,2)
x3=dynam(:,1)
y3=dynam(:,3)

plot(x2,y2,'-k',x3,y3,'--k')
xlabel('Distance from liquid (Å)','fontsize',10)
ylabel('Concentration (molecules/Å^3)','fontsize',10)            
set(gca,'fontsize',10)   

I do not see any errors in the setup and the file is enclosed

Best regards,
Bjørn



please always keep the help list copied on replies.

and again we need more information from you. please tell us the exact error messages or results you get. otherwise we don't know the problem.


Reply | Threaded
Open this post in threaded view
|

Re: axis text do not plot

bjkvamme
Thank yo
Did post now for another plot from same file

No error messages - simply do not plot

version 6.1.0 under Windows

Best regards,
Bjørn

ons. 5. mai 2021 kl. 14:35 skrev Nicholas Jankowski <[hidden email]>:
On Wed, May 5, 2021 at 3:54 AM Bjørn Kvamme <[hidden email]> wrote:
I have some other problems. Octave will not plot this file

load dynam

x2=dynam(:,1)
y2=dynam(:,2)
x3=dynam(:,1)
y3=dynam(:,3)

plot(x2,y2,'-k',x3,y3,'--k')
xlabel('Distance from liquid (Å)','fontsize',10)
ylabel('Concentration (molecules/Å^3)','fontsize',10)            
set(gca,'fontsize',10)   

I do not see any errors in the setup and the file is enclosed

Best regards,
Bjørn



please always keep the help list copied on replies.

and again we need more information from you. please tell us the exact error messages or results you get. otherwise we don't know the problem.