Permalink
Browse files

graphs now not scaling with data max=10

  • Loading branch information...
1 parent 0260551 commit 5b4afc482603e743649e811ec831c791f1cce1b5 @drewverlee committed Jan 3, 2013
Showing with 7 additions and 3 deletions.
  1. +7 −3 petalapp/graphing_tools/graph.py
@@ -6,7 +6,7 @@
'''
import matplotlib.cm as cm
-from matplotlib.pyplot import figure
+from matplotlib.pyplot import figure, gca, ylim
import StringIO
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from random import randrange as rr
@@ -17,7 +17,7 @@
#serves only as a teaching method from how to extract a num from session
#TODO: re-factor out specific data
def plotpolar(data=[], num=None):
- """data and num used to build a graph using matplotlib,
+ """data and num used to build a graph using matplotlib,
data[0] is title
data[1] is which_quarter
data[2] is hospital_name
@@ -26,6 +26,11 @@ def plotpolar(data=[], num=None):
fig = figure(figsize=(10,10))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)
+ ax = gca()
+ ax.set_autoscale_on(False)
+ #xmin,xmax,ymin,ymax
+ ylim(10)
+
deg = [360/len(hospital_labels) * x for x in range(1,len(hospital_labels)+1)]
theta = [i*pi/180 for i in deg] # convert to radians
@@ -61,4 +66,3 @@ def plotpolar(data=[], num=None):
return png_output
-

0 comments on commit 5b4afc4

Please sign in to comment.