1
$\begingroup$

I've a combination of two difficult (I'm naive) requirements :(

Consider the Weather data as example. Let's say I've dataset with following information.

"Datetime", "Word", "Frequency", "Temperature"

Visualization: I want to see change in frequency of a word over time and at temperature.

  1. X-axis shows the time series(date)
  2. Y-axis has the frequency scale(0 to max freq).

Requirements: 1. I need to draw frequencies of several words(Column "word") over the time. 2. Correlate the frequency with temperature.

I started with ggplot2:

ggplot(TemperatureData, aes(x=timeId, y=termFrequency)) + geom_line() + facet_wrap(~Keyword) + 
  geom_line(data = TemperatureData, aes(y = temperature)) + 
  labs(x="Time Series over X days", y = "Term Frequency")

The above approach results in overlapping y axis (frequency, temperature). And, a separate bin for each "Word" (facet for ggplot). i.e plot has 3 bin's for each keyword. Each bin shows temperature over time, and frequency of a word over time.

Problems: 1. I want to be able to separate y-axis for temperature, and frequency. Also, I do not want to normalize these y-axis as it gets tough to understand what are the high/low values of each axis over days. Plot Loses readability. I learned that two y-axis is not possible using ggplot2.

  1. Separate bin for each keyword is not required. One horizontal line per keyword is what I'm looking for.

  2. The plot should have only one appearance (line graph) of temperature to reflect change over time.

I tried using PAR, but could not succeed.

Example solution using plotrix package

$\endgroup$

closed as off-topic by Jason B., MarcoB, Patrick Stevens, user9660, Sjoerd C. de Vries Oct 27 '15 at 14:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "The question is out of scope for this site. The answer to this question requires either advice from Wolfram support or the services of a professional consultant." – Jason B., MarcoB, Patrick Stevens, Community
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Did you check if one of the answers to these questions is helpful? $\endgroup$ – Karsten 7. Oct 26 '15 at 16:20
  • 1
    $\begingroup$ So you want to work in R? This site is for Mathematicaquestions ... $\endgroup$ – Dr. belisarius Oct 26 '15 at 16:35
  • $\begingroup$ I'm voting to close this question as off-topic because it doesn't seem to be about Mathematica $\endgroup$ – Sjoerd C. de Vries Oct 27 '15 at 14:51

Browse other questions tagged or ask your own question.