Dear plplot-devel,
I attach a patch to fix the mis-alignment of the major axes and grid in the
case of a time-axis ('d' option). This was due to different algorithms being
applied to determine the grid and tick location. In essence, the grid didn't
subtract off the start time.
While fixing this, I also found a small bug in the tick routine for the left
y-axis again in the case of time ('d') option. This was due to a vpwymi instead
of vpwyma at this location. For reasons best known to you, the tick routines
work down the left axis and up the right axis, so the two bits of code are
different.
I attach some code to test this, plus the before and after outputs.
Steve
PS I submitted a separate patch, also to plbox, last week. If it would be
helpful, I can generate a patch that combines both sets of fixes. Both are
patched against svn 12298.
PPS in case someone is confused. My test rig plots y-axes as both a float
representation of the time (which starts at zero and runs several days) and the
plplot time (which starts at t=0 seconds, corresponding to day 001 of the
year). So the two plots don't appear to have the same y-limits but are correct.
PPPS I looked at the minor tick grid option ('h'), which works ok but is absent
in all cases unless the major grid is also requested. I guess this is probably
as intended, but does limit the ability to use different line styles,
thicknesses, and/or colours for the major and minor grid.
--------------------------------------------------------------------
Professor Steven J Schwartz Phone: +44 (0)207 594 7660
Head, Space & Atmospheric Physics Fax: +44 (0)207 594 7772
The Blackett Laboratory Email: [email protected]
Imperial College London Office: Huxley 6M67A
London SW7 2AZ, UK Web: www.sp.ph.ic.ac.uk/~sjs
--------------------------------------------------------------------
plplot12298_grid.patch.gz
Description: plplot12298_grid.patch.gz
/* sjs plplot test Feb 2013 */
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include "plConfig.h"
#include "plplot.h"
/* prototpyes */
void plot1(PLFLT xmax);
/*************************************************/
int main(int argc, const char *argv[]){
PLFLT tstart, tend;
#define NDAYS 7
tstart=0.0;
tend=NDAYS*24.*3600.; /* seconds */
plparseopts(&argc, argv, PL_PARSE_FULL);
plstar(1,2);
pladv(0);
plvpor(0.15,0.85,0.18,0.85);
plwind(tstart,tend, tstart/(24*3600), tend/(24*3600));
pltimefmt("%j");
plbox("bcnmtsdg", 0.0, 0, "bcnmtsg", 0.0, 0);
pllab("Day of Year", "Day of Year - float","");
pladv(0);
plvpor(0.15,0.85,0.15,0.85);
plwind(tstart,tend, tstart, tend);
pltimefmt("%j");
plbox("bcnmtsdg", 0.0, 0, "bcnmtsdg", 0.0, 0);
pllab("Day of Year", "Day of Year - time","");
plend();
exit(0);
}
grid_orig.ps
Description: grid_orig.ps
grid_fixed.ps
Description: grid_fixed.ps
------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
