We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a8bf7b commit 8a3bf48Copy full SHA for 8a3bf48
9 files changed
Data-Visualization/Contour Plots/contour_plot.py
@@ -0,0 +1,46 @@
1
+import plotly.graph_objects as go
2
+import numpy as np
3
+
4
+# X , Y , Z cordinates
5
+x_cord = np.arange(0, 50, 2)
6
+y_cord = np.arange(0, 50, 2)
7
+z_function = np.sin((x_cord + y_cord)/2)
8
9
+fig = go.Figure(data=go.Contour(x=x_cord,
10
+ y=y_cord,
11
+ z=z_function,
12
+ colorscale='darkmint',
13
+ contours=dict(
14
+ showlabels=False, # show labels on contours
15
+ labelfont=dict( # label font properties
16
+ size=12,
17
+ color='white',
18
+ )
19
+ ),
20
+ colorbar=dict(
21
+ thickness=25,
22
+ thicknessmode='pixels',
23
+ len=1.0,
24
+ lenmode='fraction',
25
+ outlinewidth=0,
26
+ title='Title',
27
+ titleside='right',
28
+ titlefont=dict(
29
+ size=14,
30
+ family='Arial, sans-serif')
31
32
33
34
35
36
37
+fig.update_layout(
38
+ title='Contour Plot',
39
+ xaxis_title='X Axis Title',
40
+ yaxis_title='Y Axis Title',
41
+ autosize=False,
42
+ width=900,
43
+ height=600,
44
+ margin=dict(l=50, r=50, b=100, t=100, pad=4)
45
+)
46
+fig.show()
Data-Visualization/Contour Plots/contourplot.png
84.6 KB
Data-Visualization/FunnelChart/FunnelChart.png
45.3 KB
Data-Visualization/FunnelChart/FunnelCharts.py
@@ -0,0 +1,32 @@
+from plotly import graph_objects as go
+fig = go.Figure()
+fig.add_trace(go.Funnel(
+ name = 'India',
+ y = ["McDonalds", "Dominoz", "PizzaHut", "Subway" , "MadOverDonuts" , "Keventers"],
+ x = [150, 140, 40, 50, 40 , 20],
+ textposition = "inside",
+ textinfo = "value+percent initial"))
+ name = 'Bangladesh',
+ orientation = "h",
+ y = ["McDonalds", "Dominoz", "PizzaHut", "Subway"],
+ x = [50, 60, 40, 30],
+ textinfo = "value+percent previous"))
+ name = 'SriLanka',
+ y = ["McDonalds", "Dominoz", "PizzaHut", "Subway" ,"MadOverDonuts" ],
+ x = [90, 70, 50, 30, 10],
+ textposition = "outside",
+ textinfo = "value+percent total"))
+ title = "Funnel Chart for Food Sales in Asian Countries",
+ showlegend = True
Data-Visualization/README.md
@@ -35,3 +35,16 @@ pip install plotly
# Author
[Elita Menezes](https://github.com/ELITA04/)
+## 8. Contour Plot
+[](https://postimg.cc/v114qk6q)
+## 9. Ternary Plot
+[](https://postimg.cc/crmtrQSm)
+## 10. Waterfall Chart
+[](https://postimg.cc/mc6Qh77q)
+## 11. Funnel Chart
+[](https://postimg.cc/FYTSn0CR)
47
48
49
+# Author
50
+[Divya Rao](https://github.com/dsrao711/)
Data-Visualization/TernaryPlots/TernaryPlot.py
@@ -0,0 +1,30 @@
+import plotly.express as px
+df = px.data.election()
+fig = go.Figure(go.Scatterternary({
+ 'mode': 'markers',
+ 'a': df['Joly'],
+ 'b': df['Coderre'],
+ 'c': df['Bergeron'],
+ 'marker': {
+ 'color': 'green',
+ 'size': 14,
+ } ,
+}))
+fig.update_layout({
+ 'title': 'Ternary Scatter Plot',
+ 'ternary':
+ {
+ 'sum':1,
+ 'aaxis':{'title': 'Joly', 'min': 0.01, 'linewidth':2, 'ticks':'outside' },
+ 'baxis':{'title': 'Coderre', 'min': 0.01, 'linewidth':2, 'ticks':'outside' },
+ 'caxis':{'title': 'Bergeron', 'min': 0.01, 'linewidth':2, 'ticks':'outside' }
+ },
+ 'showlegend': False
+})
Data-Visualization/TernaryPlots/ternaryplot.png
49.5 KB
Data-Visualization/WaterfallChart/WaterFall.png
30 KB
Data-Visualization/WaterfallChart/Waterfall.py
@@ -0,0 +1,24 @@
+fig = go.Figure(go.Waterfall(
+ name = "20",
+ orientation = "v",
+ measure = ["relative", "relative", "relative", "relative", "relative", "total"],
+ x = ["Exp1", "Exp2", "Exp3", "Exp4", "Exp5", "Exp6"],
+ text = ["100", "50", "130", "200", "40", "Total"],
+ y = [100, +50, 130, 200, 40, 0 ],
+ connector = {"line":{"color":"rgb(63, 63, 63)"}},
+ increasing = {"marker":{"color":"green"}},
+ totals = {"marker":{"color":"blue"}}
+))
+ title = "Waterfall Chart",
+ showlegend = True ,
0 commit comments