Scigraph axis in scientific notation?

Scigraph axis in scientific notation?

Hello,

I have a working program and now I'm working out the details and I came across an issue with the labeling of one of my axis. I'm have data that runs between 10,000 to 800,000 and I was wondering if I would be able to label my Y-axis in scientific notation instead of linear. I could use $AFLOG, or $AFLOG10 but that is not right. I would like for it be like 1.0E4 or something around that order. Is it possible to get it like that?

This is a quickwin aplication.

    retcode=GetGraphDefaults($GTXY,graph)
    graph.graphColor=$CIBRIGHTWHITE
    graph.graphBgColor=$CIBLACK!$CIBRIGHTWHITE!$CIBROWN
    graph.setGraphMode=.False.
    graph.x2=wc.numxpixels-1
    graph.y2=wc.numypixels-1
    graph.title='Intensity Vs. Bin #'   !Main Title of Graph
    graph.title2= filename
    
!    retcode=GetDataDefaults(graph,numPoints2,H1,dSettings) !testing H1(10)
    retcode=GetDataDefaults(graph,numPoints,array,dSettings)
    dSettings.markerType = $MKNONE
    dSettings.lineType = $LTSOLID
    dSettings.lineColor = $CIYELLOW
    
    retcode=GetAxisDefaults(graph,dSettings,$ATX,$AFLINEAR,axis(1))
    axis(1).title='Bin #'
    axis(1).axisPos=$APBOTTOM!$APTOP
    axis(1).tickType=$TTINSIDE
    axis(1).tickColor=$CILIGHTRED
    axis(1).minorTickColor=$CIRED
    axis(1).gridStyle=$GSNONE
    !axis(1).gridLineType = $LTNONE
        
    retcode=GetAxisDefaults(graph,dSettings,$ATY,$AFLINEAR,axis(2))
    axis(2).title='Intensity'
    axis(2).tickType=$TTINSIDE
    axis(2).tickColor=$CILIGHTRED
    axis(2).minorTickColor=$CIRED
    axis(2).gridStyle=$GSNONE
    !axis(2).gridLineType = $LTNONE
     
    retcode=PlotGraph(graph,2,axis,1)
     
!    retcode=PlotData(graph,H1,dSettings,axis(1),axis(2)) !testing H1(10)
    retcode=PlotData(graph,array,dSettings,axis(1),axis(2))
    
    status = GETWSIZEQQ(10, QWIN$SIZECURR, winfo)

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You have all the sources to Scigraph - you can tweak it in any way you want. From a brief perusal of the sources, I would suggest looking at line 420 of SGPLOT.f90 which, I think, converts the axis value to a numeric string. You could replace the F10. with EN10, or something like that.

Retired 12/31/2016

Thank you Steve for your suggesting, I made the changes and it worked great. The only issue that I did come accros was that I wasn't able to change it to EN10 for some reason. I keeped getting a rountime-error when ever I used EN or ES but I was able to change it to E which made it better. Thanks again.

Leave a Comment

Please sign in to add a comment. Not a member? Join today