Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 383889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:19:40+00:00 2026-05-12T15:19:40+00:00

I am drawing a graph on a control, but 0,0 is at the top-left

  • 0

I am drawing a graph on a control, but 0,0 is at the top-left hand corner of the control. Is there a way to flip the coordinates so that 0,0 is at the lower left corner of the control?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:19:40+00:00Added an answer on May 12, 2026 at 3:19 pm

    If you are using WinForms, then you might find that you can flip the Y-Axis using Graphics.ScaleTransform:

    private void ScaleTransformFloat(PaintEventArgs e)
    {
        // Begin graphics container
        GraphicsContainer containerState = e.Graphics.BeginContainer();
    
        // Flip the Y-Axis
        e.Graphics.ScaleTransform(1.0F, -1.0F);
    
        // Translate the drawing area accordingly
        e.Graphics.TranslateTransform(0.0F, -(float)Height);
    
        // Whatever you draw now (using this graphics context) will appear as
        // though (0,0) were at the bottom left corner
        e.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100, 40);
    
        // End graphics container
        e.Graphics.EndContainer(containerState);
    
        // Other drawing actions here...
    }
    

    You only need to include the begin/end container calls if you want to do additional drawing using the regular coordinate system as well. More information on graphics containers is available on MSDN.

    As mentioned by Tom in the comments, this approach requires the Height value to be available with a correct value. If you try this and see nothing being drawn, ensure that value is correct in a debugger.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am drawing a graph on a <canvas> that requires expensive calculations. I would
I am drawing an undirected graph with Graphviz that has redundant edges, (e.g. A
Is there a function for drawing a caption box underneath a figure/graph using matplotlib?
Possible Duplicate: Is there a way of drawing a caption box in matplotlib I
What algorithms are good for interactive/realtime graph-drawing for live data and direct-manipulation? Failing that
I'm drawing a graph in a WPF application, but lines drawn using drawingContext.DrawLine(...) are
Here is the best js graph drawing thing - http://thejit.org/static/v20/Jit/Examples/Other/example2.html It is so impressive,
I'm currently porting my jruby/java2d Graph Drawing/Layouting application to macruby/cocoa. Therefore I need to
I want to use core-plot for drawing line graph dynamically. data won't come at
I have a drawing graph on a panel. The drawing has 2 components: background

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.