Questions tagged [graph]

This "graph" tag refers to a graphical data presentation, e.g. chart or diagram. For the mathematical concept use [graph-theory].

A graph is a visual representation of the relationship between two or more variables. Graphs are especially useful for recognizing broad trends or patterns in large data-sets, and thus are often used for visualising scientific data.

Related tags:


For graphs in discrete mathematics (consisting of nodes/vertices and edges/arcs/relationships which connect pairs of these nodes/vertices), please use . You might also include one of the following tags:

  • for questions on graph-related algorithms.
  • for questions on database technologies for persisting and querying graphs.
28721 questions
100
votes
4 answers

matplotlib savefig() plots different from show()

When I use show() to plot the graphs in X, the graphs looks very good. However when I start to use savefig() to generate large amount of graphs, the savefig() generated graphs ' font, lines, polygons all look smaller than the show() generated graph.…
leon
  • 4,931
  • 7
  • 39
  • 37
99
votes
1 answer

Relationship between dpi and figure size

I have created a figure using matplotlib but I have realized the plot axis and the drawn line gets zoomed out. Reading this earlier discussion thread, it explains how to set the figure size. fig, ax = plt.subplots() fig.set_size_inches(3,…
qboomerang
  • 1,931
  • 3
  • 15
  • 20
98
votes
3 answers

How to view GitHub Contributors Graph for branches other than master?

At https://github.com/yourusername/yourreponame/graphs you can find some nice graphs showing commits over time. However the information is only for the master branch. How do I see the same information for a branch other than master, or see a graphs…
Marc M.
  • 3,631
  • 4
  • 32
  • 53
97
votes
2 answers

Dot graph language - how to make bidirectional edges automatically?

Here is a very simplified example of my Dot graph: strict digraph graphName { A->B B->A } This creates Instead I want a single edge shown between A and B but with a double arrow head. I know how to get the double arrowhead as a global…
I82Much
  • 26,901
  • 13
  • 88
  • 119
97
votes
13 answers

.NET graph library around?

I am looking for Graph libraries for .net. Are there any out? ps: I mean GRAPH libraries, not graphics nor charting libraries! edit: What I mean is graphs, from graph theory: (source: sourceforge.net) I also need it to have drawing capabilities.
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
96
votes
12 answers

Generate distinctly different RGB colors in graphs

When generating graphs and showing different sets of data it usually a good idea to difference the sets by color. So one line is red and the next is green and so on. The problem is then that when the number of datasets is unknown one needs to…
Riri
  • 11,501
  • 14
  • 63
  • 88
91
votes
13 answers

Choosing an attractive linear scale for a graph's Y Axis

I'm writing a bit of code to display a bar (or line) graph in our software. Everything's going fine. The thing that's got me stumped is labeling the Y axis. The caller can tell me how finely they want the Y scale labeled, but I seem to be stuck on…
Clinton Pierce
  • 12,859
  • 15
  • 62
  • 90
89
votes
4 answers

Comparing object graph representation to adjacency list and matrix representations

I'm currently following Steve Yegge's advice on preparing for a technical programming interview: http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html In his section on Graphs, he states: There are three basic ways to represent a…
jbeard4
  • 12,664
  • 4
  • 57
  • 67
87
votes
12 answers

What is the maximum number of edges in a directed graph with n nodes?

What is the maximum number of edges in a directed graph with n nodes? Is there any upper bound?
Loolooii
  • 8,588
  • 14
  • 66
  • 90
87
votes
5 answers

What's the difference between uniform-cost search and Dijkstra's algorithm?

I was wondering what's the difference between uniform-cost search and Dijkstra's algorithm. They seem to be the same algorithm.
Grief Coder
  • 6,508
  • 9
  • 38
  • 51
82
votes
11 answers

Finding all cycles in undirected graphs

I need a working algorithm for finding all simple cycles in an undirected graph. I know the cost can be exponential and the problem is NP-complete, but I am going to use it in a small graph (up to 20-30 vertices) and the cycles are small in…
Violin Yanev
  • 1,507
  • 2
  • 16
  • 23
81
votes
5 answers

Python equivalent to 'hold on' in Matlab

Is there an explicit equivalent command in Python's matplotlib for Matlab's hold on? I'm trying to plot all my graphs on the same axes. Some graphs are generated inside a for loop, and these are plotted separately from su and sl: import numpy as…
Medulla Oblongata
  • 3,771
  • 8
  • 36
  • 75
77
votes
2 answers

matplotlib bar graph black - how do I remove bar borders

I'm using pyplot.bar but I'm plotting so many points that the color of the bars is always black. This is because the borders of the bars are black and there are so many of them that they are all squished together so that all you see is the borders…
user1893354
  • 5,778
  • 12
  • 46
  • 83
77
votes
5 answers

Common main title of a figure panel compiled with par(mfrow)

I have a compilation of 4 plots drawn together with par(mfrow=c(2,2)). I would like to draw a common title for the 2 above plots and a common title for the 2 below panels that are centered between the 2 left and right plots. Is this possible?
ECII
  • 10,297
  • 18
  • 80
  • 121
76
votes
14 answers

Is there any 'out-of-the-box' 2D/3D plotting library for C++?

I looked at the different options for plotting functions (or other types of graphs) in an interactive window. I mostly use wxWidgets but I'd be open to any other "interfaces". Looking at what is available, here is what I've found: wxPlot: Not…
user38290
  • 761
  • 1
  • 6
  • 3