473,749 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to produce 3D graph Using MathGL

3 New Member
I want to plot a 3D graph using MathGL. There are three variables (X,Y,Z), and kinds of combination correspond different C values. Also C vector sets the color scheme. I write some codes as below. But it doesn't work. I'm not sure I use wrong functions or not.

Expand|Select|Wrap|Line Numbers
  1. mglData x("x"),y("y"),z("z"),c("c");
  2. mglGraph *gr=new mglGraphZB;
  3. gr->SetSize(1200,800);gr->Title("Eletron Density",0,5);
  4. gr->Rotate(65,35);
  5. gr->XRange(x);
  6. gr->YRange(y);
  7. gr->ZRange(z);
  8. gr->CRange(0,30);
  9. gr->Label('x',"Longitude");
  10. gr->Label('y',"Latitude");
  11. gr->Label('z',"Altitude");
  12. gr->Colorbar("BbcyrR",1.0,0.90,0.2,0.4,0.7);
  13. gr->Surf3(x,y,z,c);
  14. gr->Axis();
  15. gr->Box();
  16. gr->WritePNG("eletron_density.png");
  17.  
Apr 14 '12 #1
0 2066

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1662
by: SS KANAGAL | last post by:
Hello, I am drawing a bar graph in an aspx page using System.Drawing namespace . Now I want to provide drill down facility for the graph i.e. on click of a bar in the graph it should get me yet another graph with different data populated in that graph. I want to know how to provide href for each bar in the graph in the code behind.
11
14895
by: srinivas | last post by:
Hi all, I have one requirement.Is there any way to create a line graph using javascript.If it is please send me the sample code.But the thing is it should work in all browsers. Thanks, Srinivas
0
1401
by: ANUPAM | last post by:
Hi All, I have to show Tooltip for Bar/Pie graph using MS charts control in C# which is not available while it is in Visual Basic Version. Please help me. Thansks All, Anupam
3
3059
by: i | last post by:
Hi, I'm working with an array of nodes, numbering roughly in the thousands. Each node has at least one, but up to four, references to another node - North, South, East, or West. I'm trying to get my program to take these nodes and plot them on a graph, represented by a two-dimensional array. Right now I'm having some trouble with the recursive method I've set up, which does not seem to be efficient enough to get the job done. I
0
5812
by: Syazwin | last post by:
Hye everyone! :) i am really a new learner in vb.net. not so expert about what i am searching now.. actually i am looking for the way/source code how to make a line graph in vb.net. the system will display a graph after user enter the coordinates.beside will display the maximum and minimum point/coordinate + the graph can be save as a picture for reference in the future.i have search but not really understand to use the coding with the...
0
2708
by: suedasszyy | last post by:
Haiiii.... i'm new for VB.net. can someone help me to solve those question? is it possible to draw a graph such as Sin graph using console application? if not, how can i draw a graph ,example sin graph in window form but i must give the commands in console application ?
2
5593
by: paeh | last post by:
moving average is the process that will be executed according to certain schedule such as daily, weekly or monthly based on the data in the database. For your information, I plan to use MySQL database server. It can be produce by graph,chart or table. Actually, I want to develop web based communicable disease reporting system (Surveillance system for Flu and Entrovirus). I don't know what kind of software to develop it. can I use PHP?
1
2132
by: sainiamit25 | last post by:
Hi, I need to make a graph using javascript based on the values in the oracle table. Can somebody throw some on it? Thanks in advance for your help, Amit
6
2594
by: gubbachchi | last post by:
Hi all, I have got a problem with plotting bar graph using GD. I am learning GD now. I have written the code for basic bar graph with one bar. What I need is, scale on Y-axis i.e. divisions on y-axis like 500,1000,1500 upto value which I have mentioned in $max variable which in my case is 4000. Here is the code <?php header("Content-type: image/jpeg");
0
3477
by: eureka2050 | last post by:
Hi all, I am creating a radar chart containing 2 plots using jpgraph. My code is as follows:- include ("./jpgraph/src/jpgraph.php"); include ("./jpgraph/src/jpgraph_radar.php"); // Create the basic radar graph $graph = new RadarGraph(700,500,"auto");
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.