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 8693657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:35:43+00:00 2026-06-13T00:35:43+00:00

I want to draw ellipses, hyperbolas in R. How can I do it using

  • 0

I want to draw ellipses, hyperbolas in R.
How can I do it using ggplot2?
Let me give an example

x^2 +3xy+ 4x+ 2y+ 2y^2 = 0 

for

x between -2 and 2
y between -2 and 2
  • 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-06-13T00:35:44+00:00Added an answer on June 13, 2026 at 12:35 am

    Construct a data field:

    d <- transform(expand.grid(x=seq(-2,2,length=51),
                y=seq(-2,2,length=51)),z=x^2+3*x*y+4*x+2*y+2*y^2)
    

    Make a basic geom_contour plot with each level coloured differently:

    g1 <- qplot(x,y,z=z,data=d,colour=factor(..level..),geom="contour")
    

    Now get rid of the lines for all but the “0” level. This depends on stat_contour picking zero as one of its contour levels, which might be fragile under some circumstances … (It’s not obvious to me that stat_contour() allows control of what levels are chosen, equivalent to the levels argument to contour() or contourLines() in base R — if it did, this process would be a little bit easier. One might submit a wishlist item to https://github.com/hadley/ggplot2/issues , if one cared enough about this …)

    g1 + scale_colour_discrete(breaks="0",limits=c("0","0"),na.value=NA,
                              guide="none")
    

    enter image description here

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

Sidebar

Related Questions

I want to draw an arc using canvas using a gradient fill. How can
I want to draw some Rectangle over a single Image . For example I
I want to draw an area from given points on a map using the
I want to draw a widget (in this example, a canvas) and then remove
I want to Draw a hyper Link in C# using stringbuilder when i create
I want to draw lat log in every 1 Km interval using service. I
i am using TabControl in my windows form application (c#) and i want draw
When I'm using the SpriteBatch.Draw() method I can get vertical or horizontal scaling. For
I want to draw some ellipses when the window is loaded without clicking anything,
I want draw a Bar chart by using Android based on Android SQLite database

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.