graphing

Is there a way to draw graphs and charts in Android?

吃可爱长大的小学妹 提交于 2019-11-30 09:51:26
I am new Java and new to Android. I am trying to write an Android app that graphs data from a user based on date. Is there a way to do this in Java without using JavaScript (which I don't know)? Try below code GraphActivity class package com.graph; import android.app.Activity; import android.os.Bundle; public class GraphActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); float[] values = new float[] { 2.0f,1.5f, 2.5f, 1.0f , 3.0f }; String[] verlabels = new String[] { "great", "ok", "bad" }; String[] horlabels = new String

Cannot get minor grid lines to appear in matplotlib figure

一笑奈何 提交于 2019-11-30 07:54:31
问题 Ok so I have the code below for real-time graphing some data from an embedded device received over serial. It's not meant to be a production tool but rather an internal eng tool, hence it's not terribly user-friendly. The problem is that no matter what I do, I can't get minor grid lines to appear, even though here they are set to True, which=both . I can do anything I want to the major grid lines but the minors won't appear. Any ideas? Here is the code: import numpy as np from matplotlib

Setting `axes.linewidth` without changing the `rcParams` global dict

左心房为你撑大大i 提交于 2019-11-30 06:41:11
问题 So, it seems one cannot do the following (it raises an error, since axes does not have a set_linewidth method): axes_style = {'linewidth':5} axes_rect = [0.1, 0.1, 0.9, 0.9] axes(axes_rect, **axes_style) and has to use the following old trick instead: rcParams['axes.linewidth'] = 5 # set the value globally ... # some code rcdefaults() # restore [global] defaults Is there an easy / clean way (may be one can set x - and y - axes parameters individually, etc)? P.S. If no, why? 回答1: The above

Use image instead of labels in ggplot2 legend

此生再无相见时 提交于 2019-11-30 00:30:31
I have a plot in ggplot2 with, say, 2 lines, and in the legend I have "Sharks" and "Tigers". Is there a way I could have shark/tiger images appear in the legend instead of that text? You're much better off using ggsave to save the figure as a eps or svg , then opening it in Illustrator (or open source equivalent) and replacing the legend with the images. If you're really dead set on doing it all in R, you can use annotation_raster in the current ggplot2 and add in some text next to it using geom_text . Here is a rough attempt: set.seed(10) library(ggplot2) library(RCurl) library(png) df <-

What graphing packages/APIs exist for Perl?

别说谁变了你拦得住时间么 提交于 2019-11-29 12:35:24
问题 I'm doing some research on online Graphing packages for different languages and would like to know what current up-to-date graphing packages there are for Perl which are worth investigating Minimum desired capabilities should include the kind which Google offers through its API A brief synopsis of the key benefits of the recommended package / API would be appreciated 回答1: I've been messing around with Chart::Clicker recently. Those translucent area charts do have something for them. 回答2: You

Cannot get minor grid lines to appear in matplotlib figure

℡╲_俬逩灬. 提交于 2019-11-29 09:12:35
Ok so I have the code below for real-time graphing some data from an embedded device received over serial. It's not meant to be a production tool but rather an internal eng tool, hence it's not terribly user-friendly. The problem is that no matter what I do, I can't get minor grid lines to appear, even though here they are set to True, which=both . I can do anything I want to the major grid lines but the minors won't appear. Any ideas? Here is the code: import numpy as np from matplotlib import pyplot as plt from matplotlib import animation import serial SERIAL_PORT_NUM=9 ...a bunch of

Polar contour plot in Matplotlib

拜拜、爱过 提交于 2019-11-29 02:12:10
I have a set of data that I want to use to produce a contour plot in polar co-ordinates using Matplotlib. My data is the following: theta - 1D array of angle values radius - 1D array of radius values value - 1D array of values that I want to use for the contours These are all 1D arrays that align properly - eg: theta radius value 30 1 2.9 30 2 5.3 35 5 9.2 That is, all of the values are repeated enough times so that each row of this 'table' of three variables defines one point. How can I create a polar contour plot from these values? I've thought about converting the radius and theta values to

R plot filled.contour() output in ggpplot2

寵の児 提交于 2019-11-29 00:06:57
I want to plot this figure created with filled.contour(), but in ggplot2, how do I do this? I want to use ggplot2 because the graphing conventions are easier. The reason I want to use filled.contour() is because I tried geom_tile() and image.plot() and they both created very tile like outputs, and I need an output similar to filled.contour(). This is my figure: Code: library(akima) df <-read.table("Petra_phytoplankton+POM_xydata_minusNAs_noduplicates.txt",header=T) attach(df) names(df) fld <- with(df, interp(x = longitude, y = latitude, z = d13C)) filled.contour.ungeoreferenced <- (filled

Setting `axes.linewidth` without changing the `rcParams` global dict

倖福魔咒の 提交于 2019-11-28 21:12:25
So, it seems one cannot do the following (it raises an error, since axes does not have a set_linewidth method): axes_style = {'linewidth':5} axes_rect = [0.1, 0.1, 0.9, 0.9] axes(axes_rect, **axes_style) and has to use the following old trick instead: rcParams['axes.linewidth'] = 5 # set the value globally ... # some code rcdefaults() # restore [global] defaults Is there an easy / clean way (may be one can set x - and y - axes parameters individually, etc)? P.S. If no, why? The above answer does not work, as it is explained in the comments. I suggest to use spines. import matplotlib.pyplot as

grouped bar graph

女生的网名这么多〃 提交于 2019-11-28 06:02:55
I have the following data: bin groupname total_dist 0 rowA 377 0 rowA 306.6 0 rowB 2.1 0 rowB 110.6 1 rowA 918.1 1 rowA 463.2 1 rowB 798.2 1 rowB 1196 2 rowA 1295.1 2 rowA 1269.1 2 rowB 698 2 rowB 1022.1 Using R, I want to make a bar graph where there is a bar for rowA and a bar for rowB for each bin. I can group total_dist by one or the other ( plot(total_dist~bin) or plot(total_dist~groupname) ). But I can't figure out how to combine them. I want something that looks similar to this example: George Dontas Here is a classic solution. (Supposing your dataframe is named df ) data <- tapply(df