I solved it with these commands to label the end points of the log axis - real y= point(S).y; string Xmin = "$"+format("%.0e",true,xmin)+"$"; string Xmax = "$"+format("%.0e",true,xmax)+"$"; xtick(spk_data,shift(0,-5pt)*Label(Xmin),(xmin,y)); xtick(spk_data,shift(0,-5pt)*Label(Xmax),(xmax,y)); I am plotting a semi-log plot. The xaxis goes from 20 to 20000. I am using the following code for plotting: void plot() { picture spk_data; size(spk_data,800,400,IgnoreAspect); scale(spk_data,Log,Linear); xlimits(spk_data,20.0,20000.0);...
I figured it out, the correct call is secondaryY(plt_data, etc. then it works. If I use the default pic and then plot secondary axis (as in the example in the 2d graphs) everything works fine. If I name the graph say with picture plot_data; and execute all commands with a picture argument set to plt_data and do not try to add the secondary axis every works fine but if I then try to execute the secondary axis code I get the error - if(!primary.scale.set) abort(noprimary); ^ /usr/local/share/asymptote/graph.asy:...
If I use the default pic and then plot secondary axis (as in the example in the 2d graphs) everything works fine. If I name the graph say with picture plot_data; and execute all commands with a picture argument set to plt_data and do not try to add the secondary axis every works fine but if I then try to execute the secondary axis code I get the error - if(!primary.scale.set) abort(noprimary); ^ /usr/local/share/asymptote/graph.asy: 1823.31: Primary axis must be drawn before secondary axis Here is...
I am plotting a semi-log plot. The xaxis goes from 20 to 20000. I am using the following code for plotting: void plot() { picture spk_data; size(spk_data,800,400,IgnoreAspect); scale(spk_data,Log,Linear); xlimits(spk_data,20.0,20000.0); ylimits(spk_data,0,100); draw(spk_data,graph(spk_data,col_data[0].data,col_data[1].data),black); yaxis(spk_data,latex_names[1], LeftRight(), RightTicks(pTick=.8red, ptick=grey, extend=true)); xaxis(spk_data,latex_names[0], BottomTop(), Ticks(Label("$%.2f$",black),beginlabel=true,...
Thank you again for a really great piece of software. I proselytize it every chance I get. On 3/28/24 11:48 AM, John Bowman wrote: You forgot the picture argument to graph (which defaults to currentpicture). Just change your draw commands to read: |draw(pic,graph(pic,W_dB,flow,fhi,npts),black,"Woofer"); draw(pic,graph(pic,LM_dB,flow,fhi,npts),red,"Lower Mid Range"); draw(pic,graph(pic,UM_dB,flow,fhi,npts),green,"Upper Mid Range"); draw(pic,graph(pic,T_dB,flow,fhi,npts),blue,"Tweeter"); draw(pic,graph(pic,IN_dB,flow,fhi,npts),cyan,"System...
My bad. I only included code fragments of the critical lines. In what is not shown I import both graph and math (what is not shown is calculating the curves but does not use any graphical commands). I have attached the complete code for both cases. Note that in the case that does not work if I comment out the xaxis command I do not get an error but of course the xaxis shown is linear and not log. On 3/27/24 7:34 PM, John Bowman wrote: Among other errors, you need to |import graph;| The next error...
When I run the following code (complete program attached) -_ picture pic; size(pic,800,400,IgnoreAspect); scale(pic,Log,Linear); real flow = 1.0; real fhi = 20000.0; int npts = 1000; draw(pic,graph(W_dB,flow,fhi,npts),black,"Woofer"); draw(pic,graph(LM_dB,flow,fhi,npts),red,"Lower Mid Range"); draw(pic,graph(UM_dB,flow,fhi,npts),green,"Upper Mid Range"); draw(pic,graph(T_dB,flow,fhi,npts),blue,"Tweeter"); ylimits(pic,-40,25); yequals(pic,0); xlimits(pic,1.0,15000.0); yaxis(pic,"$\left | H_{dB}(f)...
I have a table I wish to interpolate as part of an intermediate calculation of a function I want to draw. The documentation is not clear on whether this can be done or not. It refers to an example Interpolate1.asy which I can't find. Can anyone help me out on this problem.