Inline labels in Matplotlib

Update: User cphyc has kindly created a Github repository for the code in this answer (see here), and bundled the code into a package which may be installed using pip install matplotlib-label-lines. Pretty Picture: In matplotlib it’s pretty easy to label contour plots (either automatically or by manually placing labels with mouse clicks). There does … Read more

Google Apps Script: How to set “Use column A as labels” in chart embedded in spreadsheet?

Found it! Set the option useFirstColumnAsDomain to true with EmbeddedChartBuilder.setOption. This option appears to be undocumented. I found it by going to “Publish chart” (click on the chart, then select from the drop-down in the top right) and inspecting the JavaScript data structure in the given code. To be exact, I created a chart with … Read more

How to write your own custom legends for google line chart/ Google line chart legend manipulation

Example: Build custom legend, which syncs with data and chart… google.charts.load(’44’, { callback: drawChart, packages: [‘controls’, ‘corechart’] }); function drawChart() { // adapted from a previous example var colorPallette = [‘#273746′,’#707B7C’,’#dc7633′,’#f1c40f’,’#1e8449′,’#2874a6′,’#6c3483′,’#922b21′]; var data = new google.visualization.DataTable(); data.addColumn(‘date’, ‘X’); data.addColumn(‘number’, ‘Y1’); data.addColumn(‘number’, ‘Y2’); data.addRow([new Date(2016, 0, 1), 1, 123]); data.addRow([new Date(2016, 1, 1), 6, 42]); data.addRow([new … Read more

Plot Pandas DataFrame as Bar and Line on the same one chart

The DataFrame plotting methods return a matplotlib AxesSubplot or list of AxesSubplots. (See the docs for plot, or boxplot, for instance.) You can then pass that same Axes to the next plotting method (using ax=ax) to draw on the same axes: ax = df_13_14_target[[‘month’,’2014_target_val’]].plot(x=’month’,linestyle=”-“, marker=”o”) df_13_14_target[[‘month’,’2013_val’,’2014_val’]].plot(x=’month’, kind=’bar’, ax=ax) import pandas as pd import matplotlib.pyplot as … Read more

WPF chart controls [closed]

Free tools supporting panning / zooming: Live Charts ScottPlot DynamicDataDisplay – a nice, open source data visualization library. Unfortunately it’s not been updated since April 30, 2009. OxyPlot Free tools without built in pan / zoom support: WPF Toolkit. Supports most important 2D charts, you’ll have to implement pan / zoom yourself. WPF Toolkit Development … Read more

New asp.net charting controls – will they work with MVC (eventually)?

You can use the chart controls in two ways: Generating the Image from a Controller By generating the chart and returning it as an image from an action (as Chatuman is referring to I think): Chart chart = new Chart(); chart.BackColor = Color.Transparent; chart.Width = Unit.Pixel(250); chart.Height = Unit.Pixel(100); Series series1 = new Series(“Series1”); series1.ChartArea … Read more

Percent pie chart with css only

New answer 2021 With some modern techniques we can improve the code. You can have rounded edges and also consider animation: @property –p{ syntax: ‘<number>’; inherits: true; initial-value: 1; } .pie { –p:20; /* the percentage */ –b:22px; /* the thickness */ –c:darkred; /* the color */ –w:150px; /* the size*/ width:var(–w); aspect-ratio:1/1; position:relative; display:inline-grid; … Read more