Controling Graph(Xlabel=)
-
svannorden
- Posts: 16
- Joined: Thu Aug 08, 2013 12:23 pm
Controling Graph(Xlabel=)
I'm working with a time series that has irregularly-spaced observations (e.g. number of observations per year varies) that I'm displaying with GRAPH. I'm using the XLABEL option to label the observations appropriately.
My problem is that I have far too many observations (>250) to label all of them, so the VECTOR[STRING] that I'm supplying to XLABEL only has the occasional non-null entry. Despite this, RATS allocates margins in order to "stagger" my XLabels (see example, below.)
Is there some way I can force GRAPH to put all my XLabels on the same (single) line (i.e. as with a typical time axis?)
My problem is that I have far too many observations (>250) to label all of them, so the VECTOR[STRING] that I'm supplying to XLABEL only has the occasional non-null entry. Despite this, RATS allocates margins in order to "stagger" my XLabels (see example, below.)
Is there some way I can force GRAPH to put all my XLabels on the same (single) line (i.e. as with a typical time axis?)
Re: Controling Graph(Xlabel=)
How that lays out depends upon how the labels fit. If you reduce the font size (grparm axislabels fontsize), it will squeeze them together---though you might have to go fairly low to get all of those in.
-
svannorden
- Posts: 16
- Joined: Thu Aug 08, 2013 12:23 pm
Re: Controling Graph(Xlabel=)
Thanks, Tom.
As I mentioned, I'm using the XLABEL= option on GRAPH() to supply the labels for the time axis. Oddly, the font size doesn't seem to be affected by changes in the HLABEL or the MATRIXLABELS font size on GRPARM. AXISLABELING works, but then it also changes the vertical axis.
Is it possible to change only the font size for the horizon axis labels when using XLABEL= on GRAPH()??
As I mentioned, I'm using the XLABEL= option on GRAPH() to supply the labels for the time axis. Oddly, the font size doesn't seem to be affected by changes in the HLABEL or the MATRIXLABELS font size on GRPARM. AXISLABELING works, but then it also changes the vertical axis.
Is it possible to change only the font size for the horizon axis labels when using XLABEL= on GRAPH()??
Re: Controling Graph(Xlabel=)
Those are controlled by the AXISLABELS choice. That's quite a few labels to squeeze onto the axis. Is there a reason you can't drop out more of them?
-
svannorden
- Posts: 16
- Joined: Thu Aug 08, 2013 12:23 pm
Re: Controling Graph(Xlabel=)
Here's an example (in RGF format) of the problem. Although my labels are few and small, RATS starts to stagger them over multiple lines long before it runs out of space between them.
(It will dynamically rearrange the date labels depending on the size of your screen, so you may have to shrink the graphics window a bit to get to the point where the dates are staggered.)
I'm trying to work around that.
(It will dynamically rearrange the date labels depending on the size of your screen, so you may have to shrink the graphics window a bit to get to the point where the dates are staggered.)
I'm trying to work around that.
- Attachments
-
- Doan.RGF
- You should resize the graphics window until RATS starts to stagger the date labels.
- (8.19 KiB) Downloaded 934 times
-
svannorden
- Posts: 16
- Joined: Thu Aug 08, 2013 12:23 pm
Re: Controling Graph(Xlabel=)
Yes, I know.TomDoan wrote:Those are controlled by the AXISLABELS choice.
But AXISLABELS doesn't only change the XLABELS; as I noted, it also changes the vertical axis labels (which I don't need to shrink).
Re: Controling Graph(Xlabel=)
Do you have a bunch of empty labels? It's figuring the spacing on the basis of 289 label zones (which is why it mysteriously stacks them up, since it thinks the labels are colliding).
-
svannorden
- Posts: 16
- Joined: Thu Aug 08, 2013 12:23 pm
Re: Controling Graph(Xlabel=)
Lots!
Here's the code that sets up the vector that is passed to XLABEL
So only 1 in every 30 strings is non-null.
The reason for the odd timing is that every observations corresponds to an FOMC meeting (This is more work from the Romer&Romer(2004 AER) data set.)
In the early part of the sample, they meet monthly, then 10x/yr, then finally 8x/yr.
Here's the code that sets up the vector that is passed to XLABEL
Code: Select all
DECLARE VECTOR[STRING] MTDATE(269)
DO I=1,269
IF %MOD(I,30)==1
COMPUTE MTDATE(I) = %CONCAT("19",%STRING(MTGYEAR(I)))
END DO IThe reason for the odd timing is that every observations corresponds to an FOMC meeting (This is more work from the Romer&Romer(2004 AER) data set.)
In the early part of the sample, they meet monthly, then 10x/yr, then finally 8x/yr.
Re: Controling Graph(Xlabel=)
We uploaded a new build of version 9 which checks for empty labels when laying out the axis, so it won't mysteriously think there is no room. You probably have to uninstall then redo the installation procedure.
-
svannorden
- Posts: 16
- Joined: Thu Aug 08, 2013 12:23 pm
Re: Controling Graph(Xlabel=)
Merci, Tom.
Much appreciated.
Much appreciated.