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
Related
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)
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.
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 ,
I'm trying to graph some data points. The X coordinates tend to be inversely proportional to the Y coordinates, so I decided to try graphic in '1/x' space (replace every x with 1/x).
This makes the graph a lot more evenly spaced, but there's a problem: I'm not sure how to pick where the tick marks / grid lines should go.
Here's an example graph (with points labelled by their original X coordinate):
In the above example I spaced the tick marks evenly (in the original space). They end up too clustered near the left (infinity) and too dispersed near the right. Is there a nice rule for where I should increase the spacing?
Just a link to other 'inverse space' graphs would be useful, so I can see how they placed ticks.
What I ended up doing was:
Place a major tick at every power of 10, until you get really close to the origin (infinity). Also place a major tick at infinity.
Place 9 minor ticks between each major tick, corresponding to changing the most significant digit. So 2,3,4,...9 between 1 and 10. 20,30,40,...,90 between 10 and 100.
Place labels on every major tick, until they get too close.
Also place labels on minor ticks, from right to left, whenever there's room.
The result looks like this:
Which is not great (and the colors aren't quite right), but it's good enough for my purposes for now.
I have a bar plot with xlim([1 5]) as time. Each time contains 5 different grouped data. They are very compacted and plot understanding is not clear. I am going to expand each xlim unit to every 5 grouped data be more readable in each time. How is it possible?
Also, How can i make more distance between each 5 grouped data in each time? I applied bar(data,10,'hist'); but my 5 grouped data are still compacted in each time.
You could try bar(X,Y,width), with values of width lower than the default, which is 0.8. However, that only makes the bars narrower, not closer to the each other within its group.
To make the bar groups farther apart, you could insert NaN values between them. For example:
bar(1:.5:3,[ rand(1,7); repmat(NaN,1,7); rand(1,7); repmat(NaN,1,7); rand(1,7)] ,.8)
set(gca,'xtick',1:3) % remove unwanted ticks
See figure: