Link to home
Start Free TrialLog in
Avatar of zzenith
zzenith

asked on

Java Graphics2D coordinate problem

Hi,

I am using Graphics2D to draw graphics for my data for my clustering algorithm result on a JPanel. I understand that Graphics2D start with (0,0) at the top left hand corner to do the painting. However, some of my data on the y axisis -ve value
e.g. (222, -0.002334)

so as it start from (0,0) positve value, it can never paint my data with negative y value.

I try the translate and scale method in grpahics2D, and both can only move the whole thing to other position but actually cannot solve the problem of displaying the negative value.

So my results cant be fully output to the screen.
Is there anyway I can move the (0,0) to the centre and with the ability to output the -ve value?
Does anyone have any ideas on this?

Many thanks

Z

ASKER CERTIFIED SOLUTION
Avatar of wide_awake
wide_awake

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CleanupPing
CleanupPing

zzenith:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.