• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Programming problem: determining the tick marks in a graphing program

flashbacck

Golden Member
I'm writing a java applet that graphs some data, and I'm having a hard time determining the best way to draw the tick marks on the axes. I know I could use someone's graphing library, but there are some special things I need to do in this graph, and I'm also too lazy to read through other's documentation.

One effort I tried is below. This example also isn't set up to draw minor tick marks, which I want.
mzmax and mzmin are the max and min x axis positions in data pt values.
xend is the end of the graphing space in panel coordinates
convertmztox converts the datapt into pixel position

any suggestions appreciated,
thanks.
edit: corrected mzmax and mzmin definitions
 
A second effort, that works. I think. Anyway, I've attached it below on the off chance that someone someday will want similar code.
 
I use to have a peice of scaling graph code which would scale data based on size of graph bounds. if i find it i may post it later.
 
Back
Top