- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have been trying to use scigraph in my applications replacing the old graphics, support for which has died. Mostly I use XY data plots and I have been able to make my plots. However, I need help on
a) Say my x data is between 1 and 10 and I am plotting between 2 and 5, how do I clip the graph beyond the graph border so that it does not overlay on the text and label axes, as it does now.
b) How do I draw lines and arcs ( I need to draw some shapes) on the graph using SciLine_w(2,3.,3.,5.,5.). This call gives an error currently saying the dummy type for the last 4 inputs does not match the actual value. I thought real values would work...
Any help would be appreciated.
Thanks
Sumit
I have been trying to use scigraph in my applications replacing the old graphics, support for which has died. Mostly I use XY data plots and I have been able to make my plots. However, I need help on
a) Say my x data is between 1 and 10 and I am plotting between 2 and 5, how do I clip the graph beyond the graph border so that it does not overlay on the text and label axes, as it does now.
b) How do I draw lines and arcs ( I need to draw some shapes) on the graph using SciLine_w(2,3.,3.,5.,5.). This call gives an error currently saying the dummy type for the last 4 inputs does not match the actual value. I thought real values would work...
Any help would be appreciated.
Thanks
Sumit
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I figured out how to use the
SCILINE_W by defining the variables upfront as Real *8
and then calling
call SCILine_W($LTTHICKSOLID,ab1,ab2,ba1,ba2)
However, I still need help on the clipping part and
c) How do I squeeze the graph to fit my window. Right now I have to scroll the graph down to see the legend.
using
xyGraph.x2=0.99*(wc.numxpixels-1)
xyGraph.y2=0.9*(wc.numypixels-1)
seems to work for me but may not work on someone else's computer running on a different resolution.
Thanks
SCILINE_W by defining the variables upfront as Real *8
and then calling
call SCILine_W($LTTHICKSOLID,ab1,ab2,ba1,ba2)
However, I still need help on the clipping part and
c) How do I squeeze the graph to fit my window. Right now I have to scroll the graph down to see the legend.
using
xyGraph.x2=0.99*(wc.numxpixels-1)
xyGraph.y2=0.9*(wc.numypixels-1)
seems to work for me but may not work on someone else's computer running on a different resolution.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a) I don't know if I really understand your question, but you may try the following to change the start and end values on your axes (index 1 is for x and 2 for y):
xyAxes(1).lowVal = (desired value)
xyAxes(1).highVal = (desired value)
c) I had to use the following to fitt the graph both in the window (with a black margine at the bottom) and to the paper with A4 format:
xyGraph.x2 = wc.numxpixels
xyGraph.y2 = wc.numypixels - 42
Regards,
Sabalan.
xyAxes(1).lowVal = (desired value)
xyAxes(1).highVal = (desired value)
c) I had to use the following to fitt the graph both in the window (with a black margine at the bottom) and to the paper with A4 format:
xyGraph.x2 = wc.numxpixels
xyGraph.y2 = wc.numypixels - 42
Regards,
Sabalan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your help.
I tried changing the code with both options. Doesnt seem to matter. The graph I am getting is as attached. Am I declaring them at the wrong location? (I am using them after calling GetDataDefaults)
! xyDataSet.xLOWVAL=2700.
!xyDataSet.XHighval=10700.
xyAxes(1).LOWVAL=2700.
xyAxes(1).Highval=10700.
Thanks for the A4 page settings.
I tried changing the code with both options. Doesnt seem to matter. The graph I am getting is as attached. Am I declaring them at the wrong location? (I am using them after calling GetDataDefaults)
! xyDataSet.xLOWVAL=2700.
!xyDataSet.XHighval=10700.
xyAxes(1).LOWVAL=2700.
xyAxes(1).Highval=10700.
Thanks for the A4 page settings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK. I understand now. Try this: Declare your xyData as an allocatable array, allocate it when you know how many points you want to plot, and then set the xyData values as follows:
Allocate (xyData(2, Nr_Of_Points))
xyData(1,:) = your_X_data(start_point:end_point)
xyData(2,:) = your_Y_data(start_point:end_point)
Sabalan.
Allocate (xyData(2, Nr_Of_Points))
xyData(1,:) = your_X_data(start_point:end_point)
xyData(2,:) = your_Y_data(start_point:end_point)
Sabalan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Sabalan for the input. However, I want to make most of my old code work without making too much of a change and the old graphics program used to clip data using the axis settings.
I found a way to clip the data here too by inserting the following code
Call SETCLIPRGN(int2($GXMIN/xwpr),int2($GYMIN/ywpr),int2($GXMAX/xwpr),int2($GYMAX/ywpr))
before
pgraph.didPlotGraph=pgraph.didPlotGraph+1
and again
Call SETCLIPRGN(int2($WXMIN/xwpr),int2($WYMIN/ywpr),int2($WXMAX/xwpr),int2($WYMAX/xwpr))
before drawing the legend box is drawn
DO drawLegends= 1,numSettings
This seems to work but perhaps the person at compaq who wrote the scigraph code may find a better solution.
I am now attempting to change over the other graphic utilities and need help on
a) how do I transfer or get the value of xwpr and ywpr to use the SCICENTER or SCIENDCENTER Routines that I want to use to add additional text and graphics. I have tried getphysical cood and get viewcood but that does not seem to get me the answer I need. I could write out the value of xwpr and ywpr to a file and read it from within the LINEDEMO subroutine but then I am hardcoding the location of the file and I do not like that. Is there a way to send that information from the graphics scigraph.lib file to my project such that the following code would work and not return xwpr and ywpr as zeroes
retcode=PlotData(xyGraph,xyData,xyDataSet,xyAxes(1),xyAxes(2))
!type*,xwpr,ywpr,$WXMIN,$WXMAX,$WYMIN,$WYMAX
CALL SciENDCenter(xwpr,ywpr,$WXMIN,$WXMAX,$WYMIN+292,$WYMIN+292,text1)
I found a way to clip the data here too by inserting the following code
Call SETCLIPRGN(int2($GXMIN/xwpr),int2($GYMIN/ywpr),int2($GXMAX/xwpr),int2($GYMAX/ywpr))
before
pgraph.didPlotGraph=pgraph.didPlotGraph+1
and again
Call SETCLIPRGN(int2($WXMIN/xwpr),int2($WYMIN/ywpr),int2($WXMAX/xwpr),int2($WYMAX/xwpr))
before drawing the legend box is drawn
DO drawLegends= 1,numSettings
This seems to work but perhaps the person at compaq who wrote the scigraph code may find a better solution.
I am now attempting to change over the other graphic utilities and need help on
a) how do I transfer or get the value of xwpr and ywpr to use the SCICENTER or SCIENDCENTER Routines that I want to use to add additional text and graphics. I have tried getphysical cood and get viewcood but that does not seem to get me the answer I need. I could write out the value of xwpr and ywpr to a file and read it from within the LINEDEMO subroutine but then I am hardcoding the location of the file and I do not like that. Is there a way to send that information from the graphics scigraph.lib file to my project such that the following code would work and not return xwpr and ywpr as zeroes
retcode=PlotData(xyGraph,xyData,xyDataSet,xyAxes(1),xyAxes(2))
!type*,xwpr,ywpr,$WXMIN,$WXMAX,$WYMIN,$WYMAX
CALL SciENDCenter(xwpr,ywpr,$WXMIN,$WXMAX,$WYMIN+292,$WYMIN+292,text1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that SCIGRAPH comes from MS originally and not from Compaq. Anyway, I have not been digging in it that deep and I am afraid that I can not help you this time. Sorry.
Sabalan.
Sabalan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SciGraph did originate with MS. We've (Compaq) fixed bugs over the years, but we didn't write the code. It's provided as sample code and don't provide support for questions using it.
Steve
Steve
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page