How to plot different data in parallel (in continuation of the previous one) - matlab

I have some energy 24 hour consumption data of many days.
Plotting a specific day gives me vertical axis of consumption and horizontal axis of time.
I would like to plot for lets say 1 year.
If I use "hold on/off" command, it plots all days together on top of each other.
How can i plot in a way that for the second day, the plots goes to the continue of the first plot (horizontal axis extends automatically)? So, when I have the complete plot, it shows 365 days of energy consumption based on hour. It's like the horizontal axis is repeating while the vertical axis is updating. I'm talking about MATLAB.

You can still use hold on and plot each day separately (if I understand your question properly, this is what you want, separate plotting). Simply make sure your x-axis values are correct. So e.g. if you have one measurement value per hour, the plot day 1:
plot(1:24,valDay1,'k-')
then for day 2:
plot(25:48,valDay2,'r-')
etc. This will line things up correctly. Also, consider using a datetime as x axis values

So, I found my solution which is very simple. I don't know how it didn't occur earlier.
I just had to use ";" and that's it.
Like this:
DAY=[day1;day2;day3]
plot(DAY)

Related

Plot two data sets on the same axes but offset along the x-axis

Probably my explanation is not good, I need following kind of graphs. Matlab, sigmaplot solution will be welcomed. Graphpad Prism may also be an option.
The x-axis is splitted, actually 2 data sets (same x-axis but different y-axis). it is error plot (mean I also need error bars)

set displayed scale of axis in plot?

In the model I'm working on, ticks are months, and line plots are updated once every year, i.e. every 12 ticks. As ticks accumulate, the scale within the graph changes, of course, and the number in the lower right corner of the plot increases. This number reflects the number updates that have been made to the plot--i.e. the number of years. The number is the number of years that can be represented on the plot given its current scale.
Is there a way to change this number, without changing the rest of the plot, and without changing the idea that ticks are months? It would be convenient for this maximum x-axis value to show the number of months--i.e. ticks that could be displayed, even though the plot is only updated every 12 ticks.
Use the set-plot-x-range primitive. http://ccl.northwestern.edu/netlogo/docs/dictionary.html#set-plot-x-range

Tableau Control Chart - Attribute measure incorrect

All
I have a control chart, with on the X-axis a time period, and the Y-axis the value of the measure (I'd like to plot all the points in a control chart).
However, I have 2 different values as a measure, which have the exact same date (up to a second match) but different measure values.
When I plot this on a control chart, instead of having 2 points in the control chart with value 500 and 550 for example - it gives me one point with a value of about 200.
It also gives a notification that there is a NULL value in this axis, which points to the X-axis where 2 records have the exact same date.
Any idea what I can do to make this correct - or make tableau draw the measure points correctly?
Thanks in advance!
It's difficult to answer without seeing more detail about your problem, but this sounds like a good candidate for a blended axis. (multiple measures sharing a single axis)
The easiest way to do this is to put your (probably continuous) datetime field on the row axis and one of your measures on the row axis to see one of then control plots. Then drag the second measure to the Y-axis until you see a little translucent two bar icon to indicate that you are adding a second measure to that axis, at which point you can release the pointer and you should see a two plots on the same axis.
If the scales for the two measures are radically different, you can instead drag the second measure to the right side instead to get a dual axis.

Netlogo how does time relate to ticks?

I noticed that my tick counter does not show the same as the time in my plots. It seems 1 tick is roughly equal to 2 units of time on my graphs.
I would have thought that the time in plots was related to ticks, but this doesnt seem to be the case.
How does these two relate?
If you want absolute control over both coordinates of the points you are plotting, use plotxy instead of plot.
If you just use plot, then the x coordinate just ends up being "how many times I've called plot". If you always call plot exactly once per tick, that will equal the number of ticks.
Perhaps you are, without realizing it, calling plot either more or less frequently than that...? Note that it's possible (and recommended) to have all of your plotting code inside plots, but you might also (or instead) have plotting code in the Code tab.
If you can tell us more about how you define your time unit in your graph we might be able to help you more, but as far as I know a tick 's length is all dependent on computation and its the time taken to iterate through your Go (or whenever you defined tick from start to end once! )
But you can use timer for measuring time taken after resetting timer in milliseconds :
http://ccl.northwestern.edu/netlogo/docs/dict/timer.html
In your problem, I think it's better to check interval in your plot, if it's anything other than 1 it means it does not update your plot every tick ,

Overlapping data points and spacing

I have a set of data that I plot but the points on the graphs are so closed to each other that you can't see them well nd neither their values because even when I zoom in I can't get to them all. Now what I want to do is to space them out without changing their actual values on the graph. Is the a function or any other ways to do that? I've tried changing the axis and the scale but it didn't help. Mostly those points are in the Y direction. Please help What I really mean is though these points are closed to each other I'd like to create and interval between them so they don't pile up on each other
You can make the vector you are trying to plot to be more sparse taking points after some defined intervals:
plot(x(1:10:end),y(1:10:end))
In this example, I plotted each tenth point. Does it help?