How to plot 'outside' of the a matplotlib plot? - python-2.7

I have values 1 through 5000 along the x-axis and percentage along the y-axis, however, I only want the values from 1-150 to be visible along the x-axis (in order to make the scale more usable), but I'm having trouble figuring out how to do it.
Originally, I was just excluding the data with values over 150, but that obviously doesn't work with percentages.

You can achieve this by limiting the range of the x-axis (or y-axis) of the plot: plt.xlim(1, 150) or ax.set_xlim(1, 150).

Related

Apache superset mark chart regions

Is it possible to mark/highlight regions in a superset line chart or would I need to create a custom chart?
I have a chart showing device voltage and I want to highlight where the low/critical/normal voltage range is.
I can sort of hack it by adding annotation lines and increasing the thickness of the lines to 150. This sort of works but falls apart when the y axis range changes.
Any better ideas?

Bokeh - Grouped axis with RangeTool

Is it possible to create a figure with a grouped axis AND a RangeTool?
This example demonstrates the RangeTool https://docs.bokeh.org/en/latest/docs/gallery/range_tool.html.
I have a list of tuples factors which I want to use as a grouped axis:
[('2017','Jan'),('2017','Feb')..('2019','Oct')]
In the example, the initial pan on the plot seems to be set by x_range in
p = figure(plot_height=300, plot_width=800, tools="xpan", toolbar_location=None,
x_axis_type="datetime", x_axis_location="above",
background_fill_color="#efefef", x_range=(dates[1500], dates[2500]))
However, to use a grouped x axis, one must use FactorRange ala x_range=FactorRange(*factors). I've tried various forms of indexing of factors with FactorRange and cannot get it to work. Is such a thing possible in Bokeh?
The plot in here demonstrates an example of a grouped axis:
https://docs.bokeh.org/en/latest/docs/gallery/bar_mixed.html
The RangeTool assumes an underlying numeric axis, so there is not a direct way to accomplish this. The only route I could see would be to simulate a categorical axis by using a numerical axis with a fixed ticker and tick labels that correspond to the "categories" you want, and then to plot the bars using the corresponding numerical coordinates.

Is it possible to develop the line charts with multiple colors in powerbi?

I developed the few Line charts for BMP280 sensor data in powerbi. This is one of the line chart for displaying the temperature value by time and device id.
But I want same line chart with different Color like this below image, whenever temperature value suddenly changes.
Can you please tell me is it possible to develop the Line chart with multiple colors?
If you're willing to consider a vertical bar chart instead of a line chart, you would be able to create a calculation for each row that determines whether the change is significant, potentially by comparing an aggregate of recent measurements to specific thresholds.
Once you do that, you would use this column's value as a legend for your visualization. So if a row has a value of "Significant Positive Change" (or something like that), the bar or bars showing that change can be red.
Your other alternative is to use an R-based visual, of which there are surely examples of this type of visualization. I'll update this answer if I find one that looks promising.
Instead of tending 1 data series, you can split it into 2 data series e.g. one with normal temperatures and one with high temperatures. Then you can just plot these in different colours. Just make sure that the ranges are same i.e. cannot be 'Auto'.

Google Charts - How to stretch x axis over chart's full width

I can't figure out why Google Charts draws this simple chart aligned to center and doesn't fill entire white area.
Note: X axis is discrete because it represents weeks.
Do you have any idea what can I do with it?
That is how the charts display when you use a discrete (string) axis. If you want edge-to-edge lines, you need to use a continuous (number, date, datetime, timeofday) axis. See an example of the differences here: http://jsfiddle.net/asgallant/Xfx3h/.

Google Charts axis start

Below is url that chart I am using.
http://chart.apis.google.com/chart?cht=lc&chco=99C754&chs=400x150&chds=20,1&chd=t:1.0,1.0,1.0,1.0,1.0&chxt=x,y&chxl=0:|12/07/09|12/14/09|12/21/09|12/28/09|01/04/10&1:1|10|20&chxr=1,20,0,10&chls=2&chg=25,100,1,2&chm=o,54C7C5,0,-1,5&chxtc=1,15|0,15
I want to start y-axis from 1 but in my chart is started from 0.
please help me
little look at google
show :
Axis Range chxr :
You can specify the
range of values that appear on each
axis independently, using the chxr
parameter. Note that this does not
change the scale of the chart
elements, only the scale of the axis
labels. If you want to make the axis
numbers describe the actual data
values, set and
to the lower and upper values of your
data format range, respectively. See
Axis Scaling for more information.
You must make an axis visible using
the chxt parameter if you want to
specify its range.
To specify custom axis values, use the
chxl parameter.
http://code.google.com/intl/iw/apis/chart/docs/gallery/bar_charts.html#axis_range